GPIO: omap_gpio: Fix gpio name names with device tree
authorAdam Ford <aford173@gmail.com>
Fri, 17 Aug 2018 19:37:58 +0000 (14:37 -0500)
committerTom Rini <trini@konsulko.com>
Wed, 12 Sep 2018 01:38:15 +0000 (21:38 -0400)
The GPIO bank numbers do not appear in the device tree, so this
patch makes the gpio name based on the address
(ie gpio@49054000_31 vs gpio4_31)

adam

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: Derald D. Woods <woods.technical@gmail.com>
drivers/gpio/omap_gpio.c

index 651f6994e41a6a609add5c9eb82964212ae2b576..0f1ddeff929ba2eca64de6ac4dcefbebc33c9283 100644 (file)
@@ -288,11 +288,9 @@ static int omap_gpio_probe(struct udevice *dev)
        struct gpio_bank *bank = dev_get_priv(dev);
        struct omap_gpio_platdata *plat = dev_get_platdata(dev);
        struct gpio_dev_priv *uc_priv = dev_get_uclass_priv(dev);
-       int banknum;
        char name[18], *str;
 
-       banknum = plat->bank_index;
-       sprintf(name, "GPIO%d_", banknum + 1);
+       sprintf(name, "gpio@%4x_", (unsigned int)plat->base);
        str = strdup(name);
        if (!str)
                return -ENOMEM;