aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpio/gpio-omap.c
diff options
context:
space:
mode:
authorLinus Walleij <[email protected]>2017-12-29 12:22:58 +0000
committerLinus Walleij <[email protected]>2018-01-03 07:46:08 +0000
commit088413bc0bd5f5fb66ca22a19d66a49d7154ba4c (patch)
tree35c4a2e7633d32f2973c8c3a6fbf20f98a57cee7 /drivers/gpio/gpio-omap.c
parentgpiolib: add desc validation to gpiod_set_transitory() (diff)
downloadkernel-088413bc0bd5f5fb66ca22a19d66a49d7154ba4c.tar.gz
kernel-088413bc0bd5f5fb66ca22a19d66a49d7154ba4c.zip
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 <[email protected]> Cc: Santosh Shilimkar <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: [email protected] Signed-off-by: Linus Walleij <[email protected]>
Diffstat (limited to 'drivers/gpio/gpio-omap.c')
-rw-r--r--drivers/gpio/gpio-omap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c
index 05bae9f42f52..ab5035b96886 100644
--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -1060,6 +1060,7 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)
{
struct gpio_irq_chip *irq;
static int gpio;
+ const char *label;
int irq_base = 0;
int ret;
@@ -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.base = OMAP_MPUIO(0);
} 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.ngpio = bank->width;