ARM: 7427/1: mmc: mmci: Defer probe() in case of yet uninitialized GPIOs

If the GPIOs used by the MMCI driver are not registered yet when the driver is
probe()d, they can't be used. This happens if the mmci driver is probed before
the respective GPIO controller (e.g. on the LPC32xx EA3250 board, the PCA9532
GPIO controller would be initialized via DT after mmci). Therefore, we defer
mmci in this case.

Signed-off-by: Roland Stigge <stigge@antcom.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This commit is contained in:
Roland Stigge 2012-06-17 21:14:27 +01:00 committed by Russell King
parent f433809817
commit 2805b9ab7c

View file

@ -1425,6 +1425,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
writel(0, host->base + MMCIMASK1); writel(0, host->base + MMCIMASK1);
writel(0xfff, host->base + MMCICLEAR); writel(0xfff, host->base + MMCICLEAR);
if (plat->gpio_cd == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
goto err_gpio_cd;
}
if (gpio_is_valid(plat->gpio_cd)) { if (gpio_is_valid(plat->gpio_cd)) {
ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)"); ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)");
if (ret == 0) if (ret == 0)
@ -1448,6 +1452,10 @@ static int __devinit mmci_probe(struct amba_device *dev,
if (ret >= 0) if (ret >= 0)
host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd); host->gpio_cd_irq = gpio_to_irq(plat->gpio_cd);
} }
if (plat->gpio_wp == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;
goto err_gpio_wp;
}
if (gpio_is_valid(plat->gpio_wp)) { if (gpio_is_valid(plat->gpio_wp)) {
ret = gpio_request(plat->gpio_wp, DRIVER_NAME " (wp)"); ret = gpio_request(plat->gpio_wp, DRIVER_NAME " (wp)");
if (ret == 0) if (ret == 0)