diff options
Diffstat (limited to 'drivers/mmc/host/tmio_mmc.c')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 34 |
1 files changed, 13 insertions, 21 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index ac52eb65395e..ab1adeabdd22 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -303,8 +303,7 @@ static void tmio_mmc_set_clock(struct tmio_mmc_host *host, int new_clock) | |||
303 | 303 | ||
304 | static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) | 304 | static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) |
305 | { | 305 | { |
306 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 306 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
307 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
308 | 307 | ||
309 | /* | 308 | /* |
310 | * Testing on sh-mobile showed that SDIO IRQs are unmasked when | 309 | * Testing on sh-mobile showed that SDIO IRQs are unmasked when |
@@ -327,8 +326,7 @@ static void tmio_mmc_clk_stop(struct tmio_mmc_host *host) | |||
327 | 326 | ||
328 | static void tmio_mmc_clk_start(struct tmio_mmc_host *host) | 327 | static void tmio_mmc_clk_start(struct tmio_mmc_host *host) |
329 | { | 328 | { |
330 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 329 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
331 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
332 | 330 | ||
333 | sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 | | 331 | sd_ctrl_write16(host, CTL_SD_CARD_CLK_CTL, 0x0100 | |
334 | sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); | 332 | sd_ctrl_read16(host, CTL_SD_CARD_CLK_CTL)); |
@@ -669,8 +667,7 @@ out: | |||
669 | static irqreturn_t tmio_mmc_irq(int irq, void *devid) | 667 | static irqreturn_t tmio_mmc_irq(int irq, void *devid) |
670 | { | 668 | { |
671 | struct tmio_mmc_host *host = devid; | 669 | struct tmio_mmc_host *host = devid; |
672 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 670 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
673 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
674 | unsigned int ireg, irq_mask, status; | 671 | unsigned int ireg, irq_mask, status; |
675 | unsigned int sdio_ireg, sdio_irq_mask, sdio_status; | 672 | unsigned int sdio_ireg, sdio_irq_mask, sdio_status; |
676 | 673 | ||
@@ -799,8 +796,7 @@ static void tmio_mmc_start_dma_rx(struct tmio_mmc_host *host) | |||
799 | struct scatterlist *sg = host->sg_ptr, *sg_tmp; | 796 | struct scatterlist *sg = host->sg_ptr, *sg_tmp; |
800 | struct dma_async_tx_descriptor *desc = NULL; | 797 | struct dma_async_tx_descriptor *desc = NULL; |
801 | struct dma_chan *chan = host->chan_rx; | 798 | struct dma_chan *chan = host->chan_rx; |
802 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 799 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
803 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
804 | dma_cookie_t cookie; | 800 | dma_cookie_t cookie; |
805 | int ret, i; | 801 | int ret, i; |
806 | bool aligned = true, multiple = true; | 802 | bool aligned = true, multiple = true; |
@@ -869,8 +865,7 @@ static void tmio_mmc_start_dma_tx(struct tmio_mmc_host *host) | |||
869 | struct scatterlist *sg = host->sg_ptr, *sg_tmp; | 865 | struct scatterlist *sg = host->sg_ptr, *sg_tmp; |
870 | struct dma_async_tx_descriptor *desc = NULL; | 866 | struct dma_async_tx_descriptor *desc = NULL; |
871 | struct dma_chan *chan = host->chan_tx; | 867 | struct dma_chan *chan = host->chan_tx; |
872 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 868 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
873 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
874 | dma_cookie_t cookie; | 869 | dma_cookie_t cookie; |
875 | int ret, i; | 870 | int ret, i; |
876 | bool aligned = true, multiple = true; | 871 | bool aligned = true, multiple = true; |
@@ -1063,8 +1058,7 @@ static void tmio_mmc_release_dma(struct tmio_mmc_host *host) | |||
1063 | static int tmio_mmc_start_data(struct tmio_mmc_host *host, | 1058 | static int tmio_mmc_start_data(struct tmio_mmc_host *host, |
1064 | struct mmc_data *data) | 1059 | struct mmc_data *data) |
1065 | { | 1060 | { |
1066 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 1061 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
1067 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
1068 | 1062 | ||
1069 | pr_debug("setup data transfer: blocksize %08x nr_blocks %d\n", | 1063 | pr_debug("setup data transfer: blocksize %08x nr_blocks %d\n", |
1070 | data->blksz, data->blocks); | 1064 | data->blksz, data->blocks); |
@@ -1169,8 +1163,7 @@ static void tmio_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios) | |||
1169 | static int tmio_mmc_get_ro(struct mmc_host *mmc) | 1163 | static int tmio_mmc_get_ro(struct mmc_host *mmc) |
1170 | { | 1164 | { |
1171 | struct tmio_mmc_host *host = mmc_priv(mmc); | 1165 | struct tmio_mmc_host *host = mmc_priv(mmc); |
1172 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 1166 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
1173 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
1174 | 1167 | ||
1175 | return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || | 1168 | return ((pdata->flags & TMIO_MMC_WRPROTECT_DISABLE) || |
1176 | (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1; | 1169 | (sd_ctrl_read32(host, CTL_STATUS) & TMIO_STAT_WRPROTECT)) ? 0 : 1; |
@@ -1179,8 +1172,7 @@ static int tmio_mmc_get_ro(struct mmc_host *mmc) | |||
1179 | static int tmio_mmc_get_cd(struct mmc_host *mmc) | 1172 | static int tmio_mmc_get_cd(struct mmc_host *mmc) |
1180 | { | 1173 | { |
1181 | struct tmio_mmc_host *host = mmc_priv(mmc); | 1174 | struct tmio_mmc_host *host = mmc_priv(mmc); |
1182 | struct mfd_cell *cell = host->pdev->dev.platform_data; | 1175 | struct tmio_mmc_data *pdata = mfd_get_data(host->pdev); |
1183 | struct tmio_mmc_data *pdata = cell->driver_data; | ||
1184 | 1176 | ||
1185 | if (!pdata->get_cd) | 1177 | if (!pdata->get_cd) |
1186 | return -ENOSYS; | 1178 | return -ENOSYS; |
@@ -1199,7 +1191,7 @@ static const struct mmc_host_ops tmio_mmc_ops = { | |||
1199 | #ifdef CONFIG_PM | 1191 | #ifdef CONFIG_PM |
1200 | static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) | 1192 | static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) |
1201 | { | 1193 | { |
1202 | struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; | 1194 | const struct mfd_cell *cell = mfd_get_cell(dev); |
1203 | struct mmc_host *mmc = platform_get_drvdata(dev); | 1195 | struct mmc_host *mmc = platform_get_drvdata(dev); |
1204 | int ret; | 1196 | int ret; |
1205 | 1197 | ||
@@ -1214,7 +1206,7 @@ static int tmio_mmc_suspend(struct platform_device *dev, pm_message_t state) | |||
1214 | 1206 | ||
1215 | static int tmio_mmc_resume(struct platform_device *dev) | 1207 | static int tmio_mmc_resume(struct platform_device *dev) |
1216 | { | 1208 | { |
1217 | struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; | 1209 | const struct mfd_cell *cell = mfd_get_cell(dev); |
1218 | struct mmc_host *mmc = platform_get_drvdata(dev); | 1210 | struct mmc_host *mmc = platform_get_drvdata(dev); |
1219 | int ret = 0; | 1211 | int ret = 0; |
1220 | 1212 | ||
@@ -1237,7 +1229,7 @@ out: | |||
1237 | 1229 | ||
1238 | static int __devinit tmio_mmc_probe(struct platform_device *dev) | 1230 | static int __devinit tmio_mmc_probe(struct platform_device *dev) |
1239 | { | 1231 | { |
1240 | struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; | 1232 | const struct mfd_cell *cell = mfd_get_cell(dev); |
1241 | struct tmio_mmc_data *pdata; | 1233 | struct tmio_mmc_data *pdata; |
1242 | struct resource *res_ctl; | 1234 | struct resource *res_ctl; |
1243 | struct tmio_mmc_host *host; | 1235 | struct tmio_mmc_host *host; |
@@ -1252,7 +1244,7 @@ static int __devinit tmio_mmc_probe(struct platform_device *dev) | |||
1252 | if (!res_ctl) | 1244 | if (!res_ctl) |
1253 | goto out; | 1245 | goto out; |
1254 | 1246 | ||
1255 | pdata = cell->driver_data; | 1247 | pdata = mfd_get_data(dev); |
1256 | if (!pdata || !pdata->hclk) | 1248 | if (!pdata || !pdata->hclk) |
1257 | goto out; | 1249 | goto out; |
1258 | 1250 | ||
@@ -1352,7 +1344,7 @@ out: | |||
1352 | 1344 | ||
1353 | static int __devexit tmio_mmc_remove(struct platform_device *dev) | 1345 | static int __devexit tmio_mmc_remove(struct platform_device *dev) |
1354 | { | 1346 | { |
1355 | struct mfd_cell *cell = (struct mfd_cell *)dev->dev.platform_data; | 1347 | const struct mfd_cell *cell = mfd_get_cell(dev); |
1356 | struct mmc_host *mmc = platform_get_drvdata(dev); | 1348 | struct mmc_host *mmc = platform_get_drvdata(dev); |
1357 | 1349 | ||
1358 | platform_set_drvdata(dev, NULL); | 1350 | platform_set_drvdata(dev, NULL); |