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

dt-bindings: net: marvell,orion-mdio: Fix examples

As stated in marvell-orion-mdio.txt deleted in commit 0781434af811f
("dt-bindings: net: orion-mdio: Convert to JSON schema") if
'interrupts' property is present, width of 'reg' should be 0x84.
Otherwise, width of 'reg' should be 0x4. Fix 'examples:' and add
constraints checking whether 'interrupts' property is present
and validate it against fixed values in reg.

Signed-off-by: Michał Grzelak <mig@semihalf.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Michał Grzelak and committed by
David S. Miller
91e22861 a3542b0c

+26 -4
+26 -4
Documentation/devicetree/bindings/net/marvell,orion-mdio.yaml
··· 16 16 8k has a second unit which provides an interface with the xMDIO bus. This 17 17 driver handles these interfaces. 18 18 19 - allOf: 20 - - $ref: "mdio.yaml#" 21 - 22 19 properties: 23 20 compatible: 24 21 enum: ··· 36 39 - compatible 37 40 - reg 38 41 42 + allOf: 43 + - $ref: mdio.yaml# 44 + 45 + - if: 46 + required: 47 + - interrupts 48 + 49 + then: 50 + properties: 51 + reg: 52 + items: 53 + - items: 54 + - $ref: /schemas/types.yaml#/definitions/cell 55 + - const: 0x84 56 + 57 + else: 58 + properties: 59 + reg: 60 + items: 61 + - items: 62 + - $ref: /schemas/types.yaml#/definitions/cell 63 + - enum: 64 + - 0x4 65 + - 0x10 66 + 39 67 unevaluatedProperties: false 40 68 41 69 examples: 42 70 - | 43 71 mdio@d0072004 { 44 72 compatible = "marvell,orion-mdio"; 45 - reg = <0xd0072004 0x4>; 73 + reg = <0xd0072004 0x84>; 46 74 #address-cells = <1>; 47 75 #size-cells = <0>; 48 76 interrupts = <30>;