]> git.sur5r.net Git - u-boot/blobdiff - drivers/gpio/sandbox.c
dm: core: Add logging of some common errors
[u-boot] / drivers / gpio / sandbox.c
index 4f7b62eba0ddc420acd0ea2e8903e6a58968ff37..2ef5c67ad593c153b27b6a1d393b208bbb2331f0 100644 (file)
@@ -1,6 +1,6 @@
+// SPDX-License-Identifier: GPL-2.0+
 /*
  * Copyright (c) 2011 The Chromium OS Authors.
- * SPDX-License-Identifier:    GPL-2.0+
  */
 
 #include <common.h>
@@ -11,8 +11,6 @@
 #include <dm/of.h>
 #include <dt-bindings/gpio/gpio.h>
 
-DECLARE_GLOBAL_DATA_PTR;
-
 /* Flags for each GPIO */
 #define GPIOF_OUTPUT   (1 << 0)        /* Currently set as an output */
 #define GPIOF_HIGH     (1 << 1)        /* Currently set high */
@@ -198,7 +196,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;