At present dtc produces these warnings when compiling sandbox:

arch/sandbox/dts/test.dtb: Warning (gpios_property):
        Could not get phandle node for /base-gpios:num-gpios(cell 0)
arch/sandbox/dts/test.dtb: Warning (gpios_property):
        Missing property '#gpio-cells' in node /reset-ctl or bad phandle
        (referred from /extra-gpios:num-gpios[0])

Both are due to it assuming that the 'num-gpios' property holds a phandle
pointing to a GPIO node.

To avoid these warnings, rename the sandbox property so that it does not
include the string 'gpios'.

Signed-off-by: Simon Glass <s...@chromium.org>
---

 arch/sandbox/dts/test.dts | 4 ++--
 drivers/gpio/sandbox.c    | 3 ++-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/sandbox/dts/test.dts b/arch/sandbox/dts/test.dts
index c38e3691628..b0f0ca8f19c 100644
--- a/arch/sandbox/dts/test.dts
+++ b/arch/sandbox/dts/test.dts
@@ -177,7 +177,7 @@
                gpio-controller;
                #gpio-cells = <1>;
                gpio-bank-name = "a";
-               num-gpios = <20>;
+               sandbox,gpio-count = <20>;
        };
 
        gpio_b: extra-gpios {
@@ -185,7 +185,7 @@
                gpio-controller;
                #gpio-cells = <5>;
                gpio-bank-name = "b";
-               num-gpios = <10>;
+               sandbox,gpio-count = <10>;
        };
 
        i2c@0 {
diff --git a/drivers/gpio/sandbox.c b/drivers/gpio/sandbox.c
index 4f7b62eba0d..2a18f328576 100644
--- a/drivers/gpio/sandbox.c
+++ b/drivers/gpio/sandbox.c
@@ -198,7 +198,8 @@ static int sandbox_gpio_ofdata_to_platdata(struct udevice 
*dev)
 {
        struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
 
-       uc_priv->gpio_count = dev_read_u32_default(dev, "num-gpios", 0);
+       uc_priv->gpio_count = dev_read_u32_default(dev, "sandbox,gpio-count",
+                                                  0);
        uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name");
 
        return 0;
-- 
2.16.0.rc1.238.g530d649a79-goog

_______________________________________________
U-Boot mailing list
U-Boot@lists.denx.de
https://lists.denx.de/listinfo/u-boot

Reply via email to