summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbhishek Aggarwal <aaggarwal@nvidia.com>2010-02-25 18:22:49 +0530
committerAbhishek Aggarwal <aaggarwal@nvidia.com>2010-02-25 18:22:49 +0530
commitc467ef89a27a2111ffbb3e7eb61fac740a0e547a (patch)
tree55d9c157eb120f354c5482792201ae69b8959d19
parente4e33bbec97c4b089e1c86e3561c73825c62899f (diff)
tegra mmc: Fixed data getting copied on write protected sdcard
The issue was due to incorrect card present check in sdhci-tegra.c because of which the ro status of card was always returned as -1. This implied that host does not support reading ro switch and the card was assumed to be write enabled. Fixed by correcting the card present check. Bug 657078 ([AP20/Android/Whistler/Storage]: Able to copy data even though sdcard is write-protected)
-rw-r--r--drivers/mmc/host/sdhci-tegra.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mmc/host/sdhci-tegra.c b/drivers/mmc/host/sdhci-tegra.c
index 8c759b7621a1..6385bf59cf3b 100644
--- a/drivers/mmc/host/sdhci-tegra.c
+++ b/drivers/mmc/host/sdhci-tegra.c
@@ -101,7 +101,7 @@ static int tegra_sdhci_get_ro(struct sdhci_host *host)
t_sdhci = sdhci_priv(host);
- if (!tegra_sdhci_detect(t_sdhci) && t_sdhci->wp_pin) {
+ if (tegra_sdhci_detect(t_sdhci) && t_sdhci->wp_pin) {
NvRmGpioReadPins(s_hGpioGlobal, &(t_sdhci->wp_pin), &val, 1);
return val == t_sdhci->wp_polarity;
}