Skip to content

Commit f45c197

Browse files
linuswkuba-moo
authored andcommitted
dt-bindings: net: ethernet-switch: Accept special variants
Accept special node naming variants for Marvell switches with special node names as ABI. This is maybe not the prettiest but it avoids special-casing the Marvell MV88E6xxx bindings by copying a lot of generic binding code down into that one binding just to special-case these unfixable nodes. Reviewed-by: Rob Herring <robh@kernel.org> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Linus Walleij <linus.walleij@linaro.org> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://lore.kernel.org/r/20231127-marvell-88e6152-wan-led-v9-3-272934e04681@linaro.org Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a6e44f3 commit f45c197

File tree

1 file changed

+20
-3
lines changed

1 file changed

+20
-3
lines changed

Documentation/devicetree/bindings/net/ethernet-switch.yaml

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,26 @@ description:
2020

2121
select: false
2222

23-
properties:
24-
$nodename:
25-
pattern: "^(ethernet-)?switch(@.*)?$"
23+
allOf:
24+
# This condition is here to satisfy the case where certain device
25+
# nodes have to preserve non-standard names because of
26+
# backward-compatibility with boot loaders inspecting certain
27+
# node names.
28+
- if:
29+
properties:
30+
compatible:
31+
contains:
32+
enum:
33+
- marvell,turris-mox-mv88e6085
34+
- marvell,turris-mox-mv88e6190
35+
then:
36+
properties:
37+
$nodename:
38+
pattern: "switch[0-3]@[0-3]+$"
39+
else:
40+
properties:
41+
$nodename:
42+
pattern: "^(ethernet-)?switch(@.*)?$"
2643

2744
patternProperties:
2845
"^(ethernet-)?ports$":

0 commit comments

Comments
 (0)