gpio: omap: Fix GPIO numbering for deferred probe
Subsystems (2)
PATCH 1/1 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.
--- drivers/gpio/gpio-omap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpio/gpio-omap.c +3 -1
@@ -1095,7 +1095,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) }else { bank->chip.label ="gpio" ; bank->chip.base = gpio; - gpio += bank->width; } bank->chip.ngpio = bank->width;
@@ -1105,6 +1104,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)return ret; } +if (!bank->is_mpuio) + gpio += bank->width; +#ifdef CONFIG_ARCH_OMAP1 /* * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
Signature · 1 line
2.1.4
Grygorii Strashko
maintainerPATCH 1/1 gpio: omap: Fix GPIO numbering for deferred probe
Quoted 26 lines · Tony Lindgren
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 Grygorii Strashko <[email protected]>Cc Javier Martinez Canillas <[email protected]>Cc Kevin Hilman <[email protected]>Cc Santosh Shilimkar <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- drivers/gpio/gpio-omap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpio/gpio-omap.c +0
-1@@ -1095,7 +1095,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) }else { bank->chip.label ="gpio" ; bank->chip.base = gpio; - gpio += bank->width; } bank->chip.ngpio = bank->width;
drivers/gpio/gpio-omap.c static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) · line 1112
Quoted 9 lines
drivers/gpio/gpio-omap.c +3
-0@@ -1105,6 +1104,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)return ret; } +if (!bank->is_mpuio) + gpio += bank->width; +#ifdef CONFIG_ARCH_OMAP1 /* * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop
With hope that only GPIO0 will be deferred, otherwise there will be total mess in gpios enumeration ;)
Signature · 2 lines
regards, -grygorii
PATCH 1/1 gpio: omap: Fix GPIO numbering for deferred probe
Quoted 39 lines · Grygorii Strashko
Quoted 26 lines · Tony Lindgren
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 Grygorii Strashko <[email protected]>Cc Javier Martinez Canillas <[email protected]>Cc Kevin Hilman <[email protected]>Cc Santosh Shilimkar <[email protected]>Signed-off-by Tony Lindgren <[email protected]>--- drivers/gpio/gpio-omap.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)drivers/gpio/gpio-omap.c +0
-1@@ -1095,7 +1095,6 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) }else { bank->chip.label ="gpio" ; bank->chip.base = gpio; - gpio += bank->width; } bank->chip.ngpio = bank->width;drivers/gpio/gpio-omap.c static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc) · line 1112
Quoted 9 lines
drivers/gpio/gpio-omap.c +3
-0@@ -1105,6 +1104,9 @@ static int omap_gpio_chip_init(struct gpio_bank *bank, struct irq_chip *irqc)return ret; } +if (!bank->is_mpuio) + gpio += bank->width; +#ifdef CONFIG_ARCH_OMAP1 /* * REVISIT: Once we have OMAP1 supporting SPARSE_IRQ, we can drop Reviewed-by Grygorii Strashko <[email protected]>
Quoted 2 lines
With hope that only GPIO0 will be deferred, otherwise there will be total mess in gpios enumeration ;)
Heh nope :) If pinctrl currently ever causes deferred probe things will get totally messed up.. Works fine after $subject patch.
Regards,
Tony
PATCH 1/1 gpio: omap: Fix GPIO numbering for deferred probe
In reply to Tony LindgrenQuoted 10 lines · Tony Lindgren
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 Grygorii Strashko <[email protected]>Cc Javier Martinez Canillas <[email protected]>Cc Kevin Hilman <[email protected]>Cc Santosh Shilimkar <[email protected]>Signed-off-by Tony Lindgren <[email protected]>
Patch applied with Grygorii's review tag.
Yours,
Linus Walleij