Skip to contentSkip to conversation

dt-bindings: Fix dtc warnings on reg and ranges in examples

PATCH In review Rob Herring 6 participants 6 messages Apr 9, 2020 – Apr 14, 2020

Subsystems (16)
lore
Share & tools
lore

Rob Herring

author maintainer
#0 lore raw

PATCH 1/1 dt-bindings: Fix dtc warnings on reg and ranges in examples

A recent update to dtc and changes to the default warnings introduced some new warnings in the DT binding examples:

Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.example.dts:23.13-61:
Warning (dma_ranges_format): /example-0/dram-controller@1c01000:dma-ranges: "dma-ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1)
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.example.dts:17.22-28.11:
Warning (unit_address_vs_reg): /example-0/fpga-axi@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.example.dts:34.13-54:
Warning (dma_ranges_format): /example-0/memory-controller@2c00000:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 2)
Documentation/devicetree/bindings/mfd/st,stpmic1.example.dts:19.15-79.11:
Warning (unit_address_vs_reg): /example-0/i2c@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.example.dts:28.23-31.15:
Warning (unit_address_vs_reg): /example-0/mdio@37000000/switch@10: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/rng/brcm,bcm2835.example.dts:17.5-21.11:
Warning (unit_address_vs_reg): /example-0/rng: node has a reg or ranges property, but no unit name
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.example.dts:20.20-43.11:
Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/usb/ingenic,musb.example.dts:18.28-21.11:
Warning (unit_address_vs_reg): /example-0/usb-phy@0: node has a unit name, but no reg or ranges property

Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Cc Lee Jones <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Matt Mackall <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Nicolas Saenz Julienne <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Ray Jui <[email protected]>
Cc Scott Branden <[email protected]>
Cc Mark Brown <[email protected]>

---
Will take this via the DT tree.

Rob

 .../arm/sunxi/allwinner,sun4i-a10-mbus.yaml   |  6 +++
 .../bindings/hwmon/adi,axi-fan-control.yaml   |  2 +-
 .../nvidia,tegra186-mc.yaml                   | 41 +++++++++++--------
 .../devicetree/bindings/mfd/st,stpmic1.yaml   |  2 +-
 .../bindings/net/qcom,ipq8064-mdio.yaml       |  1 +
 .../devicetree/bindings/rng/brcm,bcm2835.yaml |  2 +-
 .../bindings/spi/qcom,spi-qcom-qspi.yaml      |  2 +-
 .../devicetree/bindings/usb/ingenic,musb.yaml |  2 +-
 8 files changed, 35 insertions(+), 23 deletions(-)
Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml +6 -0
index aa0738b4d534..e713a6fe4cf7 100644
@@ -42,6 +42,10 @@ properties:
     description:
       See section 2.3.9 of the DeviceTree Specification.
 
+  '#address-cells': true
+
+  '#size-cells': true
+
 required:
   - "#interconnect-cells"
   - compatible
@@ -59,6 +63,8 @@ examples:
         compatible = "allwinner,sun5i-a13-mbus";
         reg = <0x01c01000 0x1000>;
         clocks = <&ccu CLK_MBUS>;
+        #address-cells = <1>;
+        #size-cells = <1>;
         dma-ranges = <0x00000000 0x40000000 0x20000000>;
         #interconnect-cells = <1>;
     };
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml +1 -1
index 57a240d2d026..29bb2c778c59 100644
@@ -47,7 +47,7 @@ required:
 
 examples:
   - |
-    fpga_axi: fpga-axi@0 {
+    fpga_axi: fpga-axi {
             #address-cells = <0x2>;
             #size-cells = <0x1>;
 
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +23 -18

53 lines not on this page · raw message

Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +1 -1
index d9ad9260e348..f88d13d70441 100644
@@ -274,7 +274,7 @@ examples:
   - |
     #include <dt-bindings/mfd/st,stpmic1.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
-    i2c@0 {
+    i2c {
       #address-cells = <1>;
       #size-cells = <0>;
       pmic@33 {
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml +1 -0
index b9f90081046f..67df3fe861ee 100644
@@ -48,6 +48,7 @@ examples:
 
         switch@10 {
             compatible = "qca,qca8337";
+            reg = <0x10>;
             /* ... */
         };
     };
Documentation/devicetree/bindings/rng/brcm,bcm2835.yaml +1 -1
index 89ab67f20a7f..c147900f9041 100644
@@ -39,7 +39,7 @@ additionalProperties: false
 
 examples:
   - |
-    rng {
+    rng@7e104000 {
         compatible = "brcm,bcm2835-rng";
         reg = <0x7e104000 0x10>;
         interrupts = <2 29>;
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml +1 -1
index 0cf470eaf2a0..5c16cf59ca00 100644
@@ -61,7 +61,7 @@ examples:
     #include <dt-bindings/clock/qcom,gcc-sdm845.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    soc: soc@0 {
+    soc: soc {
         #address-cells = <2>;
         #size-cells = <2>;
 
Documentation/devicetree/bindings/usb/ingenic,musb.yaml +1 -1
index 1d6877875077..c2d2ee43ba67 100644
@@ -56,7 +56,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/clock/jz4740-cgu.h>
-    usb_phy: usb-phy@0 {
+    usb_phy: usb-phy {
       compatible = "usb-nop-xceiv";
       #phy-cells = <0>;
     };
Signature · 1 line
2.20.1
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 39 lines · Rob Herring

A recent update to dtc and changes to the default warnings introduced some new warnings in the DT binding examples:

Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.example.dts:23.13-61:
Warning (dma_ranges_format): /example-0/dram-controller@1c01000:dma-ranges: "dma-ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1)
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.example.dts:17.22-28.11:
Warning (unit_address_vs_reg): /example-0/fpga-axi@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.example.dts:34.13-54:
Warning (dma_ranges_format): /example-0/memory-controller@2c00000:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 2)
Documentation/devicetree/bindings/mfd/st,stpmic1.example.dts:19.15-79.11:
Warning (unit_address_vs_reg): /example-0/i2c@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.example.dts:28.23-31.15:
Warning (unit_address_vs_reg): /example-0/mdio@37000000/switch@10: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/rng/brcm,bcm2835.example.dts:17.5-21.11:
Warning (unit_address_vs_reg): /example-0/rng: node has a reg or ranges property, but no unit name
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.example.dts:20.20-43.11:
Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/usb/ingenic,musb.example.dts:18.28-21.11:
Warning (unit_address_vs_reg): /example-0/usb-phy@0: node has a unit name, but no reg or ranges property

Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Cc Lee Jones <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Matt Mackall <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Nicolas Saenz Julienne <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Ray Jui <[email protected]>
Cc Scott Branden <[email protected]>
Cc Mark Brown <[email protected]>
Quoted 8 lines

For hwmon:

Quoted 177 lines

---
Will take this via the DT tree.

Rob

 .../arm/sunxi/allwinner,sun4i-a10-mbus.yaml   |  6 +++
 .../bindings/hwmon/adi,axi-fan-control.yaml   |  2 +-
 .../nvidia,tegra186-mc.yaml                   | 41 +++++++++++--------
 .../devicetree/bindings/mfd/st,stpmic1.yaml   |  2 +-
 .../bindings/net/qcom,ipq8064-mdio.yaml       |  1 +
 .../devicetree/bindings/rng/brcm,bcm2835.yaml |  2 +-
 .../bindings/spi/qcom,spi-qcom-qspi.yaml      |  2 +-
 .../devicetree/bindings/usb/ingenic,musb.yaml |  2 +-
 8 files changed, 35 insertions(+), 23 deletions(-)
Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml +6 -0
index aa0738b4d534..e713a6fe4cf7 100644
@@ -42,6 +42,10 @@ properties:
     description:
       See section 2.3.9 of the DeviceTree Specification.
 
+  '#address-cells': true
+
+  '#size-cells': true
+
 required:
   - "#interconnect-cells"
   - compatible
@@ -59,6 +63,8 @@ examples:
         compatible = "allwinner,sun5i-a13-mbus";
         reg = <0x01c01000 0x1000>;
         clocks = <&ccu CLK_MBUS>;
+        #address-cells = <1>;
+        #size-cells = <1>;
         dma-ranges = <0x00000000 0x40000000 0x20000000>;
         #interconnect-cells = <1>;
     };
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml +1 -1
index 57a240d2d026..29bb2c778c59 100644
@@ -47,7 +47,7 @@ required:
 
 examples:
   - |
-    fpga_axi: fpga-axi@0 {
+    fpga_axi: fpga-axi {
             #address-cells = <0x2>;
             #size-cells = <0x1>;
 
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +23 -18
index 12516bd89cf9..611bda38d187 100644
@@ -97,30 +97,35 @@ examples:
     #include <dt-bindings/clock/tegra186-clock.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    memory-controller@2c00000 {
-        compatible = "nvidia,tegra186-mc";
-        reg = <0x0 0x02c00000 0x0 0xb0000>;
-        interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
-
+    bus {
         #address-cells = <2>;
         #size-cells = <2>;
 
-        ranges = <0x0 0x02c00000 0x02c00000 0x0 0xb0000>;
+        memory-controller@2c00000 {
+            compatible = "nvidia,tegra186-mc";
+            reg = <0x0 0x02c00000 0x0 0xb0000>;
+            interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+
+            #address-cells = <2>;
+            #size-cells = <2>;
+
+            ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>;
 
-        /*
-         * Memory clients have access to all 40 bits that the memory
-         * controller can address.
-         */
-        dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
+            /*
+             * Memory clients have access to all 40 bits that the memory
+             * controller can address.
+             */
+            dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
 
-        external-memory-controller@2c60000 {
-            compatible = "nvidia,tegra186-emc";
-            reg = <0x0 0x02c60000 0x0 0x50000>;
-            interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
-            clocks = <&bpmp TEGRA186_CLK_EMC>;
-            clock-names = "emc";
+            external-memory-controller@2c60000 {
+                compatible = "nvidia,tegra186-emc";
+                reg = <0x0 0x02c60000 0x0 0x50000>;
+                interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&bpmp TEGRA186_CLK_EMC>;
+                clock-names = "emc";
 
-            nvidia,bpmp = <&bpmp>;
+                nvidia,bpmp = <&bpmp>;
+            };
         };
     };
 
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +1 -1
index d9ad9260e348..f88d13d70441 100644
@@ -274,7 +274,7 @@ examples:
   - |
     #include <dt-bindings/mfd/st,stpmic1.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
-    i2c@0 {
+    i2c {
       #address-cells = <1>;
       #size-cells = <0>;
       pmic@33 {
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml +1 -0
index b9f90081046f..67df3fe861ee 100644
@@ -48,6 +48,7 @@ examples:
 
         switch@10 {
             compatible = "qca,qca8337";
+            reg = <0x10>;
             /* ... */
         };
     };
Documentation/devicetree/bindings/rng/brcm,bcm2835.yaml +1 -1
index 89ab67f20a7f..c147900f9041 100644
@@ -39,7 +39,7 @@ additionalProperties: false
 
 examples:
   - |
-    rng {
+    rng@7e104000 {
         compatible = "brcm,bcm2835-rng";
         reg = <0x7e104000 0x10>;
         interrupts = <2 29>;
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml +1 -1
index 0cf470eaf2a0..5c16cf59ca00 100644
@@ -61,7 +61,7 @@ examples:
     #include <dt-bindings/clock/qcom,gcc-sdm845.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    soc: soc@0 {
+    soc: soc {
         #address-cells = <2>;
         #size-cells = <2>;
 
Documentation/devicetree/bindings/usb/ingenic,musb.yaml +1 -1
index 1d6877875077..c2d2ee43ba67 100644
@@ -56,7 +56,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/clock/jz4740-cgu.h>
-    usb_phy: usb-phy@0 {
+    usb_phy: usb-phy {
       compatible = "usb-nop-xceiv";
       #phy-cells = <0>;
     };
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#2 lore raw
In reply to Rob Herring
Quoted 39 lines · Rob Herring

A recent update to dtc and changes to the default warnings introduced some new warnings in the DT binding examples:

Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.example.dts:23.13-61:
Warning (dma_ranges_format): /example-0/dram-controller@1c01000:dma-ranges: "dma-ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1)
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.example.dts:17.22-28.11:
Warning (unit_address_vs_reg): /example-0/fpga-axi@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.example.dts:34.13-54:
Warning (dma_ranges_format): /example-0/memory-controller@2c00000:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 2)
Documentation/devicetree/bindings/mfd/st,stpmic1.example.dts:19.15-79.11:
Warning (unit_address_vs_reg): /example-0/i2c@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.example.dts:28.23-31.15:
Warning (unit_address_vs_reg): /example-0/mdio@37000000/switch@10: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/rng/brcm,bcm2835.example.dts:17.5-21.11:
Warning (unit_address_vs_reg): /example-0/rng: node has a reg or ranges property, but no unit name
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.example.dts:20.20-43.11:
Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/usb/ingenic,musb.example.dts:18.28-21.11:
Warning (unit_address_vs_reg): /example-0/usb-phy@0: node has a unit name, but no reg or ranges property

Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Cc Lee Jones <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Matt Mackall <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Nicolas Saenz Julienne <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Ray Jui <[email protected]>
Cc Scott Branden <[email protected]>
Cc Mark Brown <[email protected]>
Quoted 8 lines

Regards,
Bjorn

Quoted 177 lines

---
Will take this via the DT tree.

Rob

 .../arm/sunxi/allwinner,sun4i-a10-mbus.yaml   |  6 +++
 .../bindings/hwmon/adi,axi-fan-control.yaml   |  2 +-
 .../nvidia,tegra186-mc.yaml                   | 41 +++++++++++--------
 .../devicetree/bindings/mfd/st,stpmic1.yaml   |  2 +-
 .../bindings/net/qcom,ipq8064-mdio.yaml       |  1 +
 .../devicetree/bindings/rng/brcm,bcm2835.yaml |  2 +-
 .../bindings/spi/qcom,spi-qcom-qspi.yaml      |  2 +-
 .../devicetree/bindings/usb/ingenic,musb.yaml |  2 +-
 8 files changed, 35 insertions(+), 23 deletions(-)
Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml +6 -0
index aa0738b4d534..e713a6fe4cf7 100644
@@ -42,6 +42,10 @@ properties:
     description:
       See section 2.3.9 of the DeviceTree Specification.
 
+  '#address-cells': true
+
+  '#size-cells': true
+
 required:
   - "#interconnect-cells"
   - compatible
@@ -59,6 +63,8 @@ examples:
         compatible = "allwinner,sun5i-a13-mbus";
         reg = <0x01c01000 0x1000>;
         clocks = <&ccu CLK_MBUS>;
+        #address-cells = <1>;
+        #size-cells = <1>;
         dma-ranges = <0x00000000 0x40000000 0x20000000>;
         #interconnect-cells = <1>;
     };
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml +1 -1
index 57a240d2d026..29bb2c778c59 100644
@@ -47,7 +47,7 @@ required:
 
 examples:
   - |
-    fpga_axi: fpga-axi@0 {
+    fpga_axi: fpga-axi {
             #address-cells = <0x2>;
             #size-cells = <0x1>;
 
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +23 -18
index 12516bd89cf9..611bda38d187 100644
@@ -97,30 +97,35 @@ examples:
     #include <dt-bindings/clock/tegra186-clock.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    memory-controller@2c00000 {
-        compatible = "nvidia,tegra186-mc";
-        reg = <0x0 0x02c00000 0x0 0xb0000>;
-        interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
-
+    bus {
         #address-cells = <2>;
         #size-cells = <2>;
 
-        ranges = <0x0 0x02c00000 0x02c00000 0x0 0xb0000>;
+        memory-controller@2c00000 {
+            compatible = "nvidia,tegra186-mc";
+            reg = <0x0 0x02c00000 0x0 0xb0000>;
+            interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+
+            #address-cells = <2>;
+            #size-cells = <2>;
+
+            ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>;
 
-        /*
-         * Memory clients have access to all 40 bits that the memory
-         * controller can address.
-         */
-        dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
+            /*
+             * Memory clients have access to all 40 bits that the memory
+             * controller can address.
+             */
+            dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
 
-        external-memory-controller@2c60000 {
-            compatible = "nvidia,tegra186-emc";
-            reg = <0x0 0x02c60000 0x0 0x50000>;
-            interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
-            clocks = <&bpmp TEGRA186_CLK_EMC>;
-            clock-names = "emc";
+            external-memory-controller@2c60000 {
+                compatible = "nvidia,tegra186-emc";
+                reg = <0x0 0x02c60000 0x0 0x50000>;
+                interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&bpmp TEGRA186_CLK_EMC>;
+                clock-names = "emc";
 
-            nvidia,bpmp = <&bpmp>;
+                nvidia,bpmp = <&bpmp>;
+            };
         };
     };
 
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +1 -1
index d9ad9260e348..f88d13d70441 100644
@@ -274,7 +274,7 @@ examples:
   - |
     #include <dt-bindings/mfd/st,stpmic1.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
-    i2c@0 {
+    i2c {
       #address-cells = <1>;
       #size-cells = <0>;
       pmic@33 {
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml +1 -0
index b9f90081046f..67df3fe861ee 100644
@@ -48,6 +48,7 @@ examples:
 
         switch@10 {
             compatible = "qca,qca8337";
+            reg = <0x10>;
             /* ... */
         };
     };
Documentation/devicetree/bindings/rng/brcm,bcm2835.yaml +1 -1
index 89ab67f20a7f..c147900f9041 100644
@@ -39,7 +39,7 @@ additionalProperties: false
 
 examples:
   - |
-    rng {
+    rng@7e104000 {
         compatible = "brcm,bcm2835-rng";
         reg = <0x7e104000 0x10>;
         interrupts = <2 29>;
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml +1 -1
index 0cf470eaf2a0..5c16cf59ca00 100644
@@ -61,7 +61,7 @@ examples:
     #include <dt-bindings/clock/qcom,gcc-sdm845.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    soc: soc@0 {
+    soc: soc {
         #address-cells = <2>;
         #size-cells = <2>;
 
Documentation/devicetree/bindings/usb/ingenic,musb.yaml +1 -1
index 1d6877875077..c2d2ee43ba67 100644
@@ -56,7 +56,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/clock/jz4740-cgu.h>
-    usb_phy: usb-phy@0 {
+    usb_phy: usb-phy {
       compatible = "usb-nop-xceiv";
       #phy-cells = <0>;
     };
Signature · 1 line
2.20.1
Acked-by on v1 1/1
#3 lore raw
In reply to Rob Herring
Quoted 47 lines · Rob Herring

A recent update to dtc and changes to the default warnings introduced some new warnings in the DT binding examples:

Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.example.dts:23.13-61:
Warning (dma_ranges_format): /example-0/dram-controller@1c01000:dma-ranges: "dma-ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1)
Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.example.dts:17.22-28.11:
Warning (unit_address_vs_reg): /example-0/fpga-axi@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.example.dts:34.13-54:
Warning (dma_ranges_format): /example-0/memory-controller@2c00000:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 2)
Documentation/devicetree/bindings/mfd/st,stpmic1.example.dts:19.15-79.11:
Warning (unit_address_vs_reg): /example-0/i2c@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.example.dts:28.23-31.15:
Warning (unit_address_vs_reg): /example-0/mdio@37000000/switch@10: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/rng/brcm,bcm2835.example.dts:17.5-21.11:
Warning (unit_address_vs_reg): /example-0/rng: node has a reg or ranges property, but no unit name
Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.example.dts:20.20-43.11:
Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name, but no reg or ranges property
Documentation/devicetree/bindings/usb/ingenic,musb.example.dts:18.28-21.11:
Warning (unit_address_vs_reg): /example-0/usb-phy@0: node has a unit name, but no reg or ranges property

Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Cc Lee Jones <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Matt Mackall <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Nicolas Saenz Julienne <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Ray Jui <[email protected]>
Cc Scott Branden <[email protected]>
Cc Mark Brown <[email protected]>
Quoted 8 lines

---
Will take this via the DT tree.

Rob

 .../arm/sunxi/allwinner,sun4i-a10-mbus.yaml   |  6 +++
 .../bindings/hwmon/adi,axi-fan-control.yaml   |  2 +-
 .../nvidia,tegra186-mc.yaml                   | 41 +++++++++++--------
maintainer Acked-by on v1 1/1
#4 lore raw
In reply to Rob Herring
Quoted 88 lines

From: Rob Herring <[email protected]>
Sent: Donnerstag, 9. April 2020 22:25
To: [email protected]
Cc: [email protected]; Maxime Ripard <[email protected]>; Chen-Yu Tsai <[email protected]>; Sa, Nuno <[email protected]>; Jean Delvare <[email protected]>; Guenter Roeck <[email protected]>; Thierry Reding <[email protected]>; Jonathan Hunter <[email protected]>; Lee Jones <[email protected]>; Bjorn Andersson <[email protected]>; David S. Miller <[email protected]>; Matt Mackall <[email protected]>; Herbert Xu <[email protected]>; Nicolas Saenz Julienne <[email protected]>; Florian Fainelli <[email protected]>; Ray Jui <[email protected]>; Scott Branden <[email protected]>; bcm- [email protected]; Mark Brown <[email protected]>; [email protected]; [email protected]; linux-arm- [email protected]; [email protected]; linux- [email protected]; [email protected]; linux- [email protected]; [email protected]
Subject: [PATCH] dt-bindings: Fix dtc warnings on reg and ranges in examples

A recent update to dtc and changes to the default warnings introduced some new warnings in the DT binding examples:

Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10- mbus.example.dts:23.13-61:
Warning (dma_ranges_format): /example-0/dram-controller@1c01000:dma-
ranges: "dma-ranges" property has invalid length (12 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 1) Documentation/devicetree/bindings/hwmon/adi,axi-fan- control.example.dts:17.22-28.11:
Warning (unit_address_vs_reg): /example-0/fpga-axi@0: node has a unit
name, but no reg or ranges property Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186- mc.example.dts:34.13-54:
Warning (dma_ranges_format): /example-0/memory-
controller@2c00000:dma-ranges: "dma-ranges" property has invalid length (24 bytes) (parent #address-cells == 1, child #address-cells == 2, #size-cells == 2) Documentation/devicetree/bindings/mfd/st,stpmic1.example.dts:19.15- 79.11:
Warning (unit_address_vs_reg): /example-0/i2c@0: node has a unit name,
but no reg or ranges property Documentation/devicetree/bindings/net/qcom,ipq8064- mdio.example.dts:28.23-31.15:
Warning (unit_address_vs_reg): /example-0/mdio@37000000/switch@10:
node has a unit name, but no reg or ranges property Documentation/devicetree/bindings/rng/brcm,bcm2835.example.dts:17.5- 21.11:
Warning (unit_address_vs_reg): /example-0/rng: node has a reg or ranges
property, but no unit name Documentation/devicetree/bindings/spi/qcom,spi-qcom- qspi.example.dts:20.20-43.11:
Warning (unit_address_vs_reg): /example-0/soc@0: node has a unit name,
but no reg or ranges property Documentation/devicetree/bindings/usb/ingenic,musb.example.dts:18.28- 21.11:
Warning (unit_address_vs_reg): /example-0/usb-phy@0: node has a unit
name, but no reg or ranges property

Cc Maxime Ripard <[email protected]>
Cc Chen-Yu Tsai <[email protected]>
Cc "Nuno Sá" <[email protected]>
Cc Jean Delvare <[email protected]>
Cc Guenter Roeck <[email protected]>
Cc Thierry Reding <[email protected]>
Cc Jonathan Hunter <[email protected]>
Cc Lee Jones <[email protected]>
Cc Bjorn Andersson <[email protected]>
Cc "David S. Miller" <[email protected]>
Cc Matt Mackall <[email protected]>
Cc Herbert Xu <[email protected]>
Cc Nicolas Saenz Julienne <[email protected]>
Cc Florian Fainelli <[email protected]>
Cc Ray Jui <[email protected]>
Cc Scott Branden <[email protected]>
Cc Mark Brown <[email protected]>
Quoted 1 line

---

Quoted 194 lines

Will take this via the DT tree.

Rob

 .../arm/sunxi/allwinner,sun4i-a10-mbus.yaml   |  6 +++
 .../bindings/hwmon/adi,axi-fan-control.yaml   |  2 +-
 .../nvidia,tegra186-mc.yaml                   | 41 +++++++++++--------
 .../devicetree/bindings/mfd/st,stpmic1.yaml   |  2 +-
 .../bindings/net/qcom,ipq8064-mdio.yaml       |  1 +
 .../devicetree/bindings/rng/brcm,bcm2835.yaml |  2 +-
 .../bindings/spi/qcom,spi-qcom-qspi.yaml      |  2 +-
 .../devicetree/bindings/usb/ingenic,musb.yaml |  2 +-
 8 files changed, 35 insertions(+), 23 deletions(-)
(quoted diff) +0 -0

a10-mbus.yaml b/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10- mbus.yaml
index aa0738b4d534..e713a6fe4cf7 100644
--- a/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10- mbus.yaml
+++ b/Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10- mbus.yaml

Documentation/devicetree/bindings/arm/sunxi/allwinner,sun4i-a10-mbus.yaml +6 -0
@@ -42,6 +42,10 @@ properties:
     description:
       See section 2.3.9 of the DeviceTree Specification.
 
+  '#address-cells': true
+
+  '#size-cells': true
+
 required:
   - "#interconnect-cells"
   - compatible
@@ -59,6 +63,8 @@ examples:
         compatible = "allwinner,sun5i-a13-mbus";
         reg = <0x01c01000 0x1000>;
         clocks = <&ccu CLK_MBUS>;
+        #address-cells = <1>;
+        #size-cells = <1>;
         dma-ranges = <0x00000000 0x40000000 0x20000000>;
         #interconnect-cells = <1>;
     };
(quoted diff) +0 -0

control.yaml b/Documentation/devicetree/bindings/hwmon/adi,axi-fan- control.yaml
index 57a240d2d026..29bb2c778c59 100644

Documentation/devicetree/bindings/hwmon/adi,axi-fan-control.yaml +1 -1
@@ -47,7 +47,7 @@ required:
 
 examples:
   - |
-    fpga_axi: fpga-axi@0 {
+    fpga_axi: fpga-axi {
             #address-cells = <0x2>;
             #size-cells = <0x1>;
 
(quoted diff) +0 -0

controllers/nvidia,tegra186-mc.yaml b/Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186- mc.yaml
index 12516bd89cf9..611bda38d187 100644
--- a/Documentation/devicetree/bindings/memory- controllers/nvidia,tegra186-mc.yaml
+++ b/Documentation/devicetree/bindings/memory- controllers/nvidia,tegra186-mc.yaml

Documentation/devicetree/bindings/memory-controllers/nvidia,tegra186-mc.yaml +23 -18
@@ -97,30 +97,35 @@ examples:
     #include <dt-bindings/clock/tegra186-clock.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    memory-controller@2c00000 {
-        compatible = "nvidia,tegra186-mc";
-        reg = <0x0 0x02c00000 0x0 0xb0000>;
-        interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
-
+    bus {
         #address-cells = <2>;
         #size-cells = <2>;
 
-        ranges = <0x0 0x02c00000 0x02c00000 0x0 0xb0000>;
+        memory-controller@2c00000 {
+            compatible = "nvidia,tegra186-mc";
+            reg = <0x0 0x02c00000 0x0 0xb0000>;
+            interrupts = <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+
+            #address-cells = <2>;
+            #size-cells = <2>;
+
+            ranges = <0x0 0x02c00000 0x0 0x02c00000 0x0 0xb0000>;
 
-        /*
-         * Memory clients have access to all 40 bits that the memory
-         * controller can address.
-         */
-        dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
+            /*
+             * Memory clients have access to all 40 bits that the memory
+             * controller can address.
+             */
+            dma-ranges = <0x0 0x0 0x0 0x0 0x100 0x0>;
 
-        external-memory-controller@2c60000 {
-            compatible = "nvidia,tegra186-emc";
-            reg = <0x0 0x02c60000 0x0 0x50000>;
-            interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
-            clocks = <&bpmp TEGRA186_CLK_EMC>;
-            clock-names = "emc";
+            external-memory-controller@2c60000 {
+                compatible = "nvidia,tegra186-emc";
+                reg = <0x0 0x02c60000 0x0 0x50000>;
+                interrupts = <GIC_SPI 224 IRQ_TYPE_LEVEL_HIGH>;
+                clocks = <&bpmp TEGRA186_CLK_EMC>;
+                clock-names = "emc";
 
-            nvidia,bpmp = <&bpmp>;
+                nvidia,bpmp = <&bpmp>;
+            };
         };
     };
 
Documentation/devicetree/bindings/mfd/st,stpmic1.yaml +1 -1
index d9ad9260e348..f88d13d70441 100644
@@ -274,7 +274,7 @@ examples:
   - |
     #include <dt-bindings/mfd/st,stpmic1.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
-    i2c@0 {
+    i2c {
       #address-cells = <1>;
       #size-cells = <0>;
       pmic@33 {
(quoted diff) +0 -0

mdio.yaml b/Documentation/devicetree/bindings/net/qcom,ipq8064- mdio.yaml
index b9f90081046f..67df3fe861ee 100644

Documentation/devicetree/bindings/net/qcom,ipq8064-mdio.yaml +1 -0
@@ -48,6 +48,7 @@ examples:
 
         switch@10 {
             compatible = "qca,qca8337";
+            reg = <0x10>;
             /* ... */
         };
     };
Documentation/devicetree/bindings/rng/brcm,bcm2835.yaml +1 -1
index 89ab67f20a7f..c147900f9041 100644
@@ -39,7 +39,7 @@ additionalProperties: false
 
 examples:
   - |
-    rng {
+    rng@7e104000 {
         compatible = "brcm,bcm2835-rng";
         reg = <0x7e104000 0x10>;
         interrupts = <2 29>;
(quoted diff) +0 -0

qspi.yaml b/Documentation/devicetree/bindings/spi/qcom,spi-qcom- qspi.yaml
index 0cf470eaf2a0..5c16cf59ca00 100644

Documentation/devicetree/bindings/spi/qcom,spi-qcom-qspi.yaml +1 -1
@@ -61,7 +61,7 @@ examples:
     #include <dt-bindings/clock/qcom,gcc-sdm845.h>
     #include <dt-bindings/interrupt-controller/arm-gic.h>
 
-    soc: soc@0 {
+    soc: soc {
         #address-cells = <2>;
         #size-cells = <2>;
 
Documentation/devicetree/bindings/usb/ingenic,musb.yaml +1 -2
index 1d6877875077..c2d2ee43ba67 100644
@@ -56,7 +56,7 @@ additionalProperties: false
 examples:
   - |
     #include <dt-bindings/clock/jz4740-cgu.h>
-    usb_phy: usb-phy@0 {
+    usb_phy: usb-phy {
       compatible = "usb-nop-xceiv";
       #phy-cells = <0>;
     };
--

2.20.1