Commit 088413bc authored by Linus Walleij's avatar Linus Walleij

gpio: omap: Give unique labels to each GPIO bank/chip

As we need to add GPIO lookup tables to the OMAP platforms, we
need to reference each GPIO chip with a unique label. Use the GPIO
base to name each chip, "gpio-0-31", "gpio-32-63" etc.

Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Cc: Kevin Hilman <khilman@kernel.org>
Cc: linux-omap@vger.kernel.org
Signed-off-by: default avatarLinus Walleij <linus.walleij@linaro.org>
parent 156dd392
...@@ -1060,6 +1060,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) ...@@ -1060,6 +1060,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
{ {
struct gpio_irq_chip *irq; struct gpio_irq_chip *irq;
static int gpio; static int gpio;
const char *label;
int irq_base = 0; int irq_base = 0;
int ret; int ret;
...@@ -1081,7 +1082,11 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) ...@@ -1081,7 +1082,11 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
bank->chip.parent = &omap_mpuio_device.dev; bank->chip.parent = &omap_mpuio_device.dev;
bank->chip.base = OMAP_MPUIO(0); bank->chip.base = OMAP_MPUIO(0);
} else { } else {
bank->chip.label = "gpio"; label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d",
gpio, gpio + bank->width - 1);
if (!label)
return -ENOMEM;
bank->chip.label = label;
bank->chip.base = gpio; bank->chip.base = gpio;
} }
bank->chip.ngpio = bank->width; bank->chip.ngpio = bank->width;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment