aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mmc/host/mxs-mmc.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/mmc/host/mxs-mmc.c b/drivers/mmc/host/mxs-mmc.c
index 202d0966b673..76232dd277c9 100644
--- a/drivers/mmc/host/mxs-mmc.c
+++ b/drivers/mmc/host/mxs-mmc.c
@@ -160,21 +160,17 @@ struct mxs_mmc_host {
160 unsigned char bus_width; 160 unsigned char bus_width;
161 spinlock_t lock; 161 spinlock_t lock;
162 int sdio_irq_en; 162 int sdio_irq_en;
163 int wp_gpio;
163}; 164};
164 165
165static int mxs_mmc_get_ro(struct mmc_host *mmc) 166static int mxs_mmc_get_ro(struct mmc_host *mmc)
166{ 167{
167 struct mxs_mmc_host *host = mmc_priv(mmc); 168 struct mxs_mmc_host *host = mmc_priv(mmc);
168 struct mxs_mmc_platform_data *pdata =
169 mmc_dev(host->mmc)->platform_data;
170 169
171 if (!pdata) 170 if (!gpio_is_valid(host->wp_gpio))
172 return -EFAULT;
173
174 if (!gpio_is_valid(pdata->wp_gpio))
175 return -EINVAL; 171 return -EINVAL;
176 172
177 return gpio_get_value(pdata->wp_gpio); 173 return gpio_get_value(host->wp_gpio);
178} 174}
179 175
180static int mxs_mmc_get_cd(struct mmc_host *mmc) 176static int mxs_mmc_get_cd(struct mmc_host *mmc)
@@ -758,6 +754,7 @@ static int mxs_mmc_probe(struct platform_device *pdev)
758 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA; 754 mmc->caps |= MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA;
759 if (pdata->flags & SLOTF_4_BIT_CAPABLE) 755 if (pdata->flags & SLOTF_4_BIT_CAPABLE)
760 mmc->caps |= MMC_CAP_4_BIT_DATA; 756 mmc->caps |= MMC_CAP_4_BIT_DATA;
757 host->wp_gpio = pdata->wp_gpio;
761 } 758 }
762 759
763 mmc->f_min = 400000; 760 mmc->f_min = 400000;