diff options
author | Linus Walleij <linus.walleij@linaro.org> | 2017-12-29 07:22:58 -0500 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2018-01-03 02:46:08 -0500 |
commit | 088413bc0bd5f5fb66ca22a19d66a49d7154ba4c (patch) | |
tree | 35c4a2e7633d32f2973c8c3a6fbf20f98a57cee7 | |
parent | 156dd39219b159d03762af32f1a0acd05d0cd726 (diff) |
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: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-omap.c | 7 |
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) | |||
1060 | { | 1060 | { |
1061 | struct gpio_irq_chip *irq; | 1061 | struct gpio_irq_chip *irq; |
1062 | static int gpio; | 1062 | static int gpio; |
1063 | const char *label; | ||
1063 | int irq_base = 0; | 1064 | int irq_base = 0; |
1064 | int ret; | 1065 | int ret; |
1065 | 1066 | ||
@@ -1081,7 +1082,11 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) | |||
1081 | bank->chip.parent = &omap_mpuio_device.dev; | 1082 | bank->chip.parent = &omap_mpuio_device.dev; |
1082 | bank->chip.base = OMAP_MPUIO(0); | 1083 | bank->chip.base = OMAP_MPUIO(0); |
1083 | } else { | 1084 | } else { |
1084 | bank->chip.label = "gpio"; | 1085 | label = devm_kasprintf(bank->chip.parent, GFP_KERNEL, "gpio-%d-%d", |
1086 | gpio, gpio + bank->width - 1); | ||
1087 | if (!label) | ||
1088 | return -ENOMEM; | ||
1089 | bank->chip.label = label; | ||
1085 | bank->chip.base = gpio; | 1090 | bank->chip.base = gpio; |
1086 | } | 1091 | } |
1087 | bank->chip.ngpio = bank->width; | 1092 | bank->chip.ngpio = bank->width; |