[PATCH] Make MMCI driver compile without gpiolib

From
Russell King - ARM Linux <hidden>
Date
2009-09-27 15:31:08
Reply to
Linus Walleij, 2009-08-26
On Wed, Aug 26, 2009 at 10:56:28AM +0200, Linus Walleij wrote:
The recent addition of optional gpiolib support to check if a
card was inserted or write protected was really not optional.
It needs this ifdef to become optional so that U300 compiles,
for example.
Looking back at this, I don't think this ifdef is required.

Why?

We're using linux/gpio.h, which provides dummy definitions for the
GPIO functions of GENERIC_GPIO is not set.  If GENERIC_GPIO is set,
then GPIOs are available, and can be used.

GPIOLIB is entirely a different matter, and doesn't really indicate
whether GPIO support is available or not.

The real problem is that U300 doesn't implement gpio_is_valid() -
which is part of the GPIO API and not specific to GPIOLIB.

Please implement this function, and let's revert this (wrong) patch.
quoted hunk ↗ jump to hunk
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 5eb86a8..a923ee2 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -619,6 +619,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 	writel(0, host->base + MMCIMASK1);
 	writel(0xfff, host->base + MMCICLEAR);
 
+#ifdef CONFIG_GPIOLIB
 	if (gpio_is_valid(plat->gpio_cd)) {
 		ret = gpio_request(plat->gpio_cd, DRIVER_NAME " (cd)");
 		if (ret == 0)
@@ -637,6 +638,7 @@ static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
 		else if (ret != -ENOSYS)
 			goto err_gpio_wp;
 	}
+#endif
 
 	ret = request_irq(dev->irq[0], mmci_irq, IRQF_SHARED, DRIVER_NAME " (cmd)", host);
 	if (ret)
Thread (6 messages) 6 messages, 4 authors, last reply 2009-09-28
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help