aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2010-07-29 15:58:59 +0100
committerRussell King <rmk+kernel@arm.linux.org.uk>2010-07-30 23:16:32 +0100
commit74bc80931c8bc34d24545f992a35349ad548897c (patch)
tree402cb830059e78812ba32d3aa9245cc82c3a8ca3 /drivers
parentARM: 6279/1: highmem: fix SMP preemption bug in kmap_high_l1_vipt (diff)
downloadlinux-dev-74bc80931c8bc34d24545f992a35349ad548897c.tar.xz
linux-dev-74bc80931c8bc34d24545f992a35349ad548897c.zip
ARM: Fix Versatile/Realview/VExpress MMC card detection sense
The MMC card detection sense has become really confused with negations at various levels, leading to some platforms not detecting inserted cards. Fix this by converting everything to positive logic throughout, thereby getting rid of these negations. Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/mmci.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 4917af96bae1..2ed435bd4b6c 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -539,9 +539,13 @@ static int mmci_get_cd(struct mmc_host *mmc)
if (host->gpio_cd == -ENOSYS)
status = host->plat->status(mmc_dev(host->mmc));
else
- status = gpio_get_value(host->gpio_cd);
+ status = !gpio_get_value(host->gpio_cd);
- return !status;
+ /*
+ * Use positive logic throughout - status is zero for no card,
+ * non-zero for card inserted.
+ */
+ return status;
}
static const struct mmc_host_ops mmci_ops = {