aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/at91_mci.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/at91_mci.c')
-rw-r--r--drivers/mmc/host/at91_mci.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 8979ad330a4d..b9d4ed6b29b1 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -793,19 +793,15 @@ static irqreturn_t at91_mmc_det_irq(int irq, void *_host)
793 793
794static int at91_mci_get_ro(struct mmc_host *mmc) 794static int at91_mci_get_ro(struct mmc_host *mmc)
795{ 795{
796 int read_only = 0;
797 struct at91mci_host *host = mmc_priv(mmc); 796 struct at91mci_host *host = mmc_priv(mmc);
798 797
799 if (host->board->wp_pin) { 798 if (host->board->wp_pin)
800 read_only = gpio_get_value(host->board->wp_pin); 799 return !!gpio_get_value(host->board->wp_pin);
801 printk(KERN_WARNING "%s: card is %s\n", mmc_hostname(mmc), 800 /*
802 (read_only ? "read-only" : "read-write") ); 801 * Board doesn't support read only detection; let the mmc core
803 } 802 * decide what to do.
804 else { 803 */
805 printk(KERN_WARNING "%s: host does not support reading read-only " 804 return -ENOSYS;
806 "switch. Assuming write-enable.\n", mmc_hostname(mmc));
807 }
808 return read_only;
809} 805}
810 806
811static const struct mmc_host_ops at91_mci_ops = { 807static const struct mmc_host_ops at91_mci_ops = {