diff options
author | Tony Lindgren <tony@atomide.com> | 2015-09-03 13:31:27 -0400 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2015-09-14 03:12:04 -0400 |
commit | 46d4f7c25e1bb59b1663878b843a7ec06eaf5806 (patch) | |
tree | 70bc3bf46d49224b26c1aab1779706dfc6568dad | |
parent | ae80d64ee8c88b77c58254bcdc5c0981faab672d (diff) |
gpio: omap: Fix GPIO numbering for deferred probe
If gpio-omap probe fails with -EPROBE_DEFER, the GPIO numbering
keeps increasing. Only increase the gpio count if gpiochip_add()
was successful as otherwise the numbers will increase for each
probe attempt.
Cc: Javier Martinez Canillas <javier@dowhile0.org>
Cc: Kevin Hilman <khilman@deeprootsystems.com>
Cc: Santosh Shilimkar <ssantosh@kernel.org>
Reviewed-by: Grygorii Strashko <grygorii.strashko@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
-rw-r--r-- | drivers/gpio/gpio-omap.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 892a9d1192fd..072af5239bc1 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -1098,7 +1098,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) | |||
1098 | } else { | 1098 | } else { |
1099 | bank->chip.label = "gpio"; | 1099 | bank->chip.label = "gpio"; |
1100 | bank->chip.base = gpio; | 1100 | bank->chip.base = gpio; |
1101 | gpio += bank->width; | ||
1102 | } | 1101 | } |
1103 | bank->chip.ngpio = bank->width; | 1102 | bank->chip.ngpio = bank->width; |
1104 | 1103 | ||
@@ -1108,6 +1107,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) | |||
1108 | return ret; | 1107 | return ret; |
1109 | } | 1108 | } |
1110 | 1109 | ||
1110 | if (!bank->is_mpuio) | ||
1111 | gpio += bank->width; | ||
1112 | |||
1111 | #ifdef CONFIG_ARCH_OMAP1 | 1113 | #ifdef CONFIG_ARCH_OMAP1 |
1112 | /* | 1114 | /* |
1113 | * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop | 1115 | * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop |