]> git.sur5r.net Git - u-boot/blobdiff - drivers/gpio/omap_gpio.c
Merge branch 'master' of git://git.denx.de/u-boot-sh
[u-boot] / drivers / gpio / omap_gpio.c
index 559f29b8018ce832253b484e9d2330c1a183cd24..79a975ce71b7ef5de446d61ef0cec79daa247e9c 100644 (file)
@@ -1,9 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Copyright (c) 2009 Wind River Systems, Inc.
  * Tom Rix <Tom.Rix@windriver.com>
  *
- * SPDX-License-Identifier:    GPL-2.0
- *
  * This work is derived from the linux 2.6.27 kernel source
  * To fetch, use the kernel repository
  * git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
@@ -289,11 +288,17 @@ 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;
 
-       uc_priv->bank_name = plat->port_name;
+       banknum = plat->bank_index;
+       sprintf(name, "GPIO%d_", banknum + 1);
+       str = strdup(name);
+       if (!str)
+               return -ENOMEM;
+       uc_priv->bank_name = str;
        uc_priv->gpio_count = GPIO_PER_BANK;
        bank->base = (void *)plat->base;
-
        return 0;
 }