diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2015-01-13 07:57:22 +0300 |
---|---|---|
committer | Ulf Hansson <ulf.hansson@linaro.org> | 2015-01-20 12:19:50 +0300 |
commit | 94b110aff8679b14f46fd6653ea87b42fe1555be (patch) | |
tree | 182f4c7dcf4dbc931875e49fc5982ce7698eb023 /drivers/mmc/host/sh_mobile_sdhi.c | |
parent | ec6f34e5b552fb0a52e6aae1a5afbbb1605cc6cc (diff) | |
download | linux-94b110aff8679b14f46fd6653ea87b42fe1555be.tar.xz |
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/sh_mobile_sdhi.c')
-rw-r--r-- | drivers/mmc/host/sh_mobile_sdhi.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/drivers/mmc/host/sh_mobile_sdhi.c b/drivers/mmc/host/sh_mobile_sdhi.c index 00c8ebdf8ec7..cf062c4d87a9 100644 --- a/drivers/mmc/host/sh_mobile_sdhi.c +++ b/drivers/mmc/host/sh_mobile_sdhi.c @@ -113,7 +113,7 @@ static int sh_mobile_sdhi_wait_idle(struct tmio_mmc_host *host) udelay(1); if (!timeout) { - dev_warn(host->pdata->dev, "timeout waiting for SD bus idle\n"); + dev_warn(&host->pdev->dev, "timeout waiting for SD bus idle\n"); return -EBUSY; } @@ -207,6 +207,12 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) goto eclkget; } + host = tmio_mmc_host_alloc(pdev); + if (!host) { + ret = -ENOMEM; + goto eprobe; + } + mmc_data->clk_enable = sh_mobile_sdhi_clk_enable; mmc_data->clk_disable = sh_mobile_sdhi_clk_disable; mmc_data->capabilities = MMC_CAP_MMC_HIGHSPEED; @@ -274,9 +280,9 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) /* SD control register space size is 0x100, 0x200 for bus_shift=1 */ mmc_data->bus_shift = resource_size(res) >> 9; - ret = tmio_mmc_host_probe(&host, pdev, mmc_data); + ret = tmio_mmc_host_probe(host, mmc_data); if (ret < 0) - goto eprobe; + goto efree; /* * FIXME: @@ -351,6 +357,8 @@ static int sh_mobile_sdhi_probe(struct platform_device *pdev) eirq: tmio_mmc_host_remove(host); +efree: + tmio_mmc_host_free(host); eprobe: eclkget: if (p && p->cleanup) |