diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-01-12 23:57:22 -0500 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-20 04:19:50 -0500 |
commit | 94b110aff8679b14f46fd6653ea87b42fe1555be (patch) | |
tree | 182f4c7dcf4dbc931875e49fc5982ce7698eb023 /drivers/mmc/host/tmio_mmc.c | |
parent | ec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff) |
mmc: tmio: add tmio_mmc_host_alloc/free()
Current tmio_mmc driver is using tmio_mmc_data for driver/platform
specific data/callback, and it is needed for tmio_mmc_host_probe()
function. Because of this style, include/linux/mfd/tmio.h header has
tmio driver/framework specific data which is not needed from platform.
This patch adds new tmio_mmc_host_alloc/free() as cleanup preparation.
tmio driver specific data/callback will be implemented in tmio_mmc_host,
and platform specific data/callback will be implemented in tmio_mmc_data
in this cleanup.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/tmio_mmc.c')
-rw-r--r-- | drivers/mmc/host/tmio_mmc.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c index 2ca0afaab792..a7c2e459187c 100644 --- a/drivers/mmc/host/tmio_mmc.c +++ b/drivers/mmc/host/tmio_mmc.c | |||
@@ -92,10 +92,14 @@ static int tmio_mmc_probe(struct platform_device *pdev) | |||
92 | pdata->bus_shift = resource_size(res) >> 10; | 92 | pdata->bus_shift = resource_size(res) >> 10; |
93 | pdata->flags |= TMIO_MMC_HAVE_HIGH_REG; | 93 | pdata->flags |= TMIO_MMC_HAVE_HIGH_REG; |
94 | 94 | ||
95 | ret = tmio_mmc_host_probe(&host, pdev, pdata); | 95 | host = tmio_mmc_host_alloc(pdev); |
96 | if (ret) | 96 | if (!host) |
97 | goto cell_disable; | 97 | goto cell_disable; |
98 | 98 | ||
99 | ret = tmio_mmc_host_probe(host, pdata); | ||
100 | if (ret) | ||
101 | goto host_free; | ||
102 | |||
99 | ret = request_irq(irq, tmio_mmc_irq, IRQF_TRIGGER_FALLING, | 103 | ret = request_irq(irq, tmio_mmc_irq, IRQF_TRIGGER_FALLING, |
100 | dev_name(&pdev->dev), host); | 104 | dev_name(&pdev->dev), host); |
101 | if (ret) | 105 | if (ret) |
@@ -108,6 +112,8 @@ static int tmio_mmc_probe(struct platform_device *pdev) | |||
108 | 112 | ||
109 | host_remove: | 113 | host_remove: |
110 | tmio_mmc_host_remove(host); | 114 | tmio_mmc_host_remove(host); |
115 | host_free: | ||
116 | tmio_mmc_host_free(host); | ||
111 | cell_disable: | 117 | cell_disable: |
112 | if (cell->disable) | 118 | if (cell->disable) |
113 | cell->disable(pdev); | 119 | cell->disable(pdev); |