Re: [PATCH] gpio: omap: Fix GPIO numbering for deferred probe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 09/03/2015 08:31 PM, Tony Lindgren wrote:
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 <grygorii.strashko@xxxxxx>
Cc: Javier Martinez Canillas <javier@xxxxxxxxxxxx>
Cc: Kevin Hilman <khilman@xxxxxxxxxxxxxxxxxxx>
Cc: Santosh Shilimkar <ssantosh@xxxxxxxxxx>
Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>
---
  drivers/gpio/gpio-omap.c | 4 +++-
  1 file changed, 3 insertions(+), 1 deletion(-)

--- a/drivers/gpio/gpio-omap.c
+++ b/drivers/gpio/gpio-omap.c
@@ -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


Reviewed-by: Grygorii Strashko <grygorii.strashko@xxxxxx>

With hope that only GPIO0 will be deferred, otherwise
there will be total mess in gpios enumeration ;)

--
regards,
-grygorii
--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux