Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Linus Walleij and committed by
Jakub Kicinski
f45c1974 a6e44f30

+20 -3
+20 -3
Documentation/devicetree/bindings/net/ethernet-switch.yaml
··· 20 20 21 21 select: false 22 22 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(@.*)?$" 26 43 27 44 patternProperties: 28 45 "^(ethernet-)?ports$":