]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
ARM: 5731/2: Fix U300 generic GPIO, remove ifdefs from MMCI v3
authorLinus Walleij <linus.walleij@stericsson.com>
Mon, 28 Sep 2009 11:36:18 +0000 (12:36 +0100)
committerRussell King <rmk+kernel@arm.linux.org.uk>
Thu, 1 Oct 2009 15:26:15 +0000 (16:26 +0100)
The #ifdefs in the MMCI driver were erroneous and just masking
a bug in the U300 generic GPIO implementation. This removes the
ifdefs and fixes the U300 generic GPIO instead.

Signed-off-by: Linus Walleij <linus.walleij@stericsson.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
arch/arm/mach-u300/gpio.c
arch/arm/mach-u300/include/mach/gpio.h
drivers/mmc/host/mmci.c

index 63c8f27fb15a3bc6a5eba1ec4bb8742f02275081..0b35826b7d1d419a5daf875cdf1cfc215fac726c 100644 (file)
@@ -281,6 +281,16 @@ int gpio_unregister_callback(unsigned gpio)
 }
 EXPORT_SYMBOL(gpio_unregister_callback);
 
+/* Non-zero means valid */
+int gpio_is_valid(int number)
+{
+       if (number >= 0 &&
+           number < (U300_GPIO_NUM_PORTS * U300_GPIO_PINS_PER_PORT))
+               return 1;
+       return 0;
+}
+EXPORT_SYMBOL(gpio_is_valid);
+
 int gpio_request(unsigned gpio, const char *label)
 {
        if (gpio_pin[gpio].users)
index c8174128d7ebc167ec0e700894348b5f33ab9029..7b1fc984abb64c85dd3124eba6b6b108000835b9 100644 (file)
 #define PIN_TO_PORT(val) (val >> 3)
 
 /* These can be found in arch/arm/mach-u300/gpio.c */
+extern int gpio_is_valid(int number);
 extern int gpio_request(unsigned gpio, const char *label);
 extern void gpio_free(unsigned gpio);
 extern int gpio_direction_input(unsigned gpio);
index 3d1e5329da12b9f84a141f544c0aaac8e0f8d92c..705a5894a6bbae304a76b37f649ee0be474b89c4 100644 (file)
@@ -678,7 +678,6 @@ 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)
@@ -697,7 +696,6 @@ 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)