aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorShawn Guo <shawn.guo@linaro.org>2012-05-06 01:33:40 -0400
committerShawn Guo <shawn.guo@linaro.org>2012-05-12 20:05:58 -0400
commit31b0ff5e7390a955f0d7279ab922e4b41469729d (patch)
treec626eda686845bfe4795a5614f8ed72ee921295f /drivers
parentb60188c820347040087bfe329f77b286dfd50a7e (diff)
mmc: mxs-mmc: copy wp_gpio in struct mxs_mmc_host
Copy wp_gpio from platform_data into struct mxs_mmc_host, so that the use of platform_data can be limited in probe function, which will ease the device tree probe. Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Marek Vasut <marex@denx.de> Acked-by: Chris Ball <cjb@laptop.org>
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;