From fbfca4b8781757c1950b2225ba67d83072e0bc07 Mon Sep 17 00:00:00 2001 From: Ben Nizette Date: Fri, 18 Jul 2008 16:48:09 +1000 Subject: avr32: clean up mci platform code This patch does a few small cleanups around the atmel mci platform code and in the atmel-mci driver. The platform changes simply removes an unused variable, uses the fact that by the end we always have some form of platform data and notes that GPIO_PIN_NONE != 0. This last point could cause the incorrect attempt to twice reserve pin PA0. While we've got the hood up, add linux/err.h to the atmel-mci.c include list. It needs it and generally pulls it by voodoo but I did once stumble across a config which don't build. This is against Linus' latest git. Signed-off-by: Ben Nizette Signed-off-by: Haavard Skinnemoen --- drivers/mmc/host/atmel-mci.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index cce873c5a14..c2f8aa840e8 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include -- cgit v1.2.3 From db6ea2c17cef531a58f48c51c3a0892edcaf1380 Mon Sep 17 00:00:00 2001 From: Huang Weiyi Date: Sat, 21 Jun 2008 22:30:43 +0800 Subject: drivers/misc/atmel-ssc.c: Removed duplicated include Removed duplicated include file in drivers/misc/atmel-ssc.c. Signed-off-by: Huang Weiyi Signed-off-by: Haavard Skinnemoen --- drivers/misc/atmel-ssc.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers') diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c index e171650766c..bf5e4d06543 100644 --- a/drivers/misc/atmel-ssc.c +++ b/drivers/misc/atmel-ssc.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3 From 3c26e17032e42cfbe606882288223ad6146e4c38 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Sun, 27 Jul 2008 02:34:45 -0700 Subject: avr32: some mmc/sd cleanups Minor cleanups for the MMC/SD support on avr32: - Make at32_add_device_mci() properly initialize "missing" platform data ... so boards like STK1002 won't try GPIO 0. - Switch over to gpio_is_valid() instead of testing for only one designated value. - Provide STK1002 platform data for the unlikely case that switches are set so first Ethernet controller isn't in use. (That's the only way to get card detect and writeprotect switch sensing on the STK1000.) And get rid of one "unused variable" warning. Signed-off-by: David Brownell Signed-off-by: Haavard Skinnemoen --- drivers/mmc/host/atmel-mci.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c index 82bbbe99816..992b4beb757 100644 --- a/drivers/mmc/host/atmel-mci.c +++ b/drivers/mmc/host/atmel-mci.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -28,7 +29,6 @@ #include #include -#include #include "atmel-mci-regs.h" @@ -574,7 +574,7 @@ static int atmci_get_ro(struct mmc_host *mmc) int read_only = 0; struct atmel_mci *host = mmc_priv(mmc); - if (host->wp_pin >= 0) { + if (gpio_is_valid(host->wp_pin)) { read_only = gpio_get_value(host->wp_pin); dev_dbg(&mmc->class_dev, "card is %s\n", read_only ? "read-only" : "read-write"); @@ -636,7 +636,7 @@ static void atmci_detect_change(unsigned long data) * been freed. */ smp_rmb(); - if (host->detect_pin < 0) + if (!gpio_is_valid(host->detect_pin)) return; enable_irq(gpio_to_irq(host->detect_pin)); @@ -1051,7 +1051,7 @@ static int __init atmci_probe(struct platform_device *pdev) /* Assume card is present if we don't have a detect pin */ host->present = 1; - if (host->detect_pin >= 0) { + if (gpio_is_valid(host->detect_pin)) { if (gpio_request(host->detect_pin, "mmc_detect")) { dev_dbg(&mmc->class_dev, "no detect pin available\n"); host->detect_pin = -1; @@ -1059,7 +1059,7 @@ static int __init atmci_probe(struct platform_device *pdev) host->present = !gpio_get_value(host->detect_pin); } } - if (host->wp_pin >= 0) { + if (gpio_is_valid(host->wp_pin)) { if (gpio_request(host->wp_pin, "mmc_wp")) { dev_dbg(&mmc->class_dev, "no WP pin available\n"); host->wp_pin = -1; @@ -1070,7 +1070,7 @@ static int __init atmci_probe(struct platform_device *pdev) mmc_add_host(mmc); - if (host->detect_pin >= 0) { + if (gpio_is_valid(host->detect_pin)) { setup_timer(&host->detect_timer, atmci_detect_change, (unsigned long)host); @@ -1113,7 +1113,7 @@ static int __exit atmci_remove(struct platform_device *pdev) if (host) { /* Debugfs stuff is cleaned up by mmc core */ - if (host->detect_pin >= 0) { + if (gpio_is_valid(host->detect_pin)) { int pin = host->detect_pin; /* Make sure the timer doesn't enable the interrupt */ @@ -1133,7 +1133,7 @@ static int __exit atmci_remove(struct platform_device *pdev) mci_readl(host, SR); clk_disable(host->mck); - if (host->wp_pin >= 0) + if (gpio_is_valid(host->wp_pin)) gpio_free(host->wp_pin); free_irq(platform_get_irq(pdev, 0), host->mmc); -- cgit v1.2.3