Browse Source

sandbox: Rename 'num-gpios' property to avoid dtc warning

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 <sjg@chromium.org>
Simon Glass 7 years ago
parent
commit
995b60b593
3 changed files with 6 additions and 5 deletions
  1. 2 2
      arch/sandbox/dts/sandbox.dts
  2. 2 2
      arch/sandbox/dts/test.dts
  3. 2 1
      drivers/gpio/sandbox.c

+ 2 - 2
arch/sandbox/dts/sandbox.dts

@@ -70,7 +70,7 @@
 		compatible = "sandbox,gpio";
 		compatible = "sandbox,gpio";
 		#gpio-cells = <1>;
 		#gpio-cells = <1>;
 		gpio-bank-name = "a";
 		gpio-bank-name = "a";
-		num-gpios = <20>;
+		sandbox,gpio-count = <20>;
 	};
 	};
 
 
 	gpio_b: gpios@1 {
 	gpio_b: gpios@1 {
@@ -78,7 +78,7 @@
 		compatible = "sandbox,gpio";
 		compatible = "sandbox,gpio";
 		#gpio-cells = <2>;
 		#gpio-cells = <2>;
 		gpio-bank-name = "b";
 		gpio-bank-name = "b";
-		num-gpios = <10>;
+		sandbox,gpio-count = <10>;
 	};
 	};
 
 
 	hexagon {
 	hexagon {

+ 2 - 2
arch/sandbox/dts/test.dts

@@ -177,7 +177,7 @@
 		gpio-controller;
 		gpio-controller;
 		#gpio-cells = <1>;
 		#gpio-cells = <1>;
 		gpio-bank-name = "a";
 		gpio-bank-name = "a";
-		num-gpios = <20>;
+		sandbox,gpio-count = <20>;
 	};
 	};
 
 
 	gpio_b: extra-gpios {
 	gpio_b: extra-gpios {
@@ -185,7 +185,7 @@
 		gpio-controller;
 		gpio-controller;
 		#gpio-cells = <5>;
 		#gpio-cells = <5>;
 		gpio-bank-name = "b";
 		gpio-bank-name = "b";
-		num-gpios = <10>;
+		sandbox,gpio-count = <10>;
 	};
 	};
 
 
 	i2c@0 {
 	i2c@0 {

+ 2 - 1
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);
 	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");
 	uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name");
 
 
 	return 0;
 	return 0;