aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/omap_hsmmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/mmc/host/omap_hsmmc.c')
-rw-r--r--drivers/mmc/host/omap_hsmmc.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 54bfd0cc106b..fedd258cc4ea 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -178,7 +178,8 @@ struct omap_hsmmc_host {
178 178
179static int omap_hsmmc_card_detect(struct device *dev, int slot) 179static int omap_hsmmc_card_detect(struct device *dev, int slot)
180{ 180{
181 struct omap_mmc_platform_data *mmc = dev->platform_data; 181 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
182 struct omap_mmc_platform_data *mmc = host->pdata;
182 183
183 /* NOTE: assumes card detect signal is active-low */ 184 /* NOTE: assumes card detect signal is active-low */
184 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); 185 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
@@ -186,7 +187,8 @@ static int omap_hsmmc_card_detect(struct device *dev, int slot)
186 187
187static int omap_hsmmc_get_wp(struct device *dev, int slot) 188static int omap_hsmmc_get_wp(struct device *dev, int slot)
188{ 189{
189 struct omap_mmc_platform_data *mmc = dev->platform_data; 190 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
191 struct omap_mmc_platform_data *mmc = host->pdata;
190 192
191 /* NOTE: assumes write protect signal is active-high */ 193 /* NOTE: assumes write protect signal is active-high */
192 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp); 194 return gpio_get_value_cansleep(mmc->slots[0].gpio_wp);
@@ -194,7 +196,8 @@ static int omap_hsmmc_get_wp(struct device *dev, int slot)
194 196
195static int omap_hsmmc_get_cover_state(struct device *dev, int slot) 197static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
196{ 198{
197 struct omap_mmc_platform_data *mmc = dev->platform_data; 199 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
200 struct omap_mmc_platform_data *mmc = host->pdata;
198 201
199 /* NOTE: assumes card detect signal is active-low */ 202 /* NOTE: assumes card detect signal is active-low */
200 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin); 203 return !gpio_get_value_cansleep(mmc->slots[0].switch_pin);
@@ -204,7 +207,8 @@ static int omap_hsmmc_get_cover_state(struct device *dev, int slot)
204 207
205static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot) 208static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
206{ 209{
207 struct omap_mmc_platform_data *mmc = dev->platform_data; 210 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
211 struct omap_mmc_platform_data *mmc = host->pdata;
208 212
209 disable_irq(mmc->slots[0].card_detect_irq); 213 disable_irq(mmc->slots[0].card_detect_irq);
210 return 0; 214 return 0;
@@ -212,7 +216,8 @@ static int omap_hsmmc_suspend_cdirq(struct device *dev, int slot)
212 216
213static int omap_hsmmc_resume_cdirq(struct device *dev, int slot) 217static int omap_hsmmc_resume_cdirq(struct device *dev, int slot)
214{ 218{
215 struct omap_mmc_platform_data *mmc = dev->platform_data; 219 struct omap_hsmmc_host *host = dev_get_drvdata(dev);
220 struct omap_mmc_platform_data *mmc = host->pdata;
216 221
217 enable_irq(mmc->slots[0].card_detect_irq); 222 enable_irq(mmc->slots[0].card_detect_irq);
218 return 0; 223 return 0;
@@ -2009,9 +2014,9 @@ static int __devexit omap_hsmmc_remove(struct platform_device *pdev)
2009 clk_put(host->dbclk); 2014 clk_put(host->dbclk);
2010 } 2015 }
2011 2016
2012 mmc_free_host(host->mmc); 2017 omap_hsmmc_gpio_free(host->pdata);
2013 iounmap(host->base); 2018 iounmap(host->base);
2014 omap_hsmmc_gpio_free(pdev->dev.platform_data); 2019 mmc_free_host(host->mmc);
2015 2020
2016 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2021 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2017 if (res) 2022 if (res)