summaryrefslogtreecommitdiffstats
path: root/drivers/mmc/host/tmio_mmc.c
diff options
context:
space:
mode:
authorMasahiro Yamada2018-01-17 17:28:01 +0100
committerUlf Hansson2018-01-18 09:08:56 +0100
commit8d09a13386ccdee8fb6d66aa2cfedbbc9255f892 (patch)
tree6fdde1ef07579de4e1709f2bc14d10299dda8a66 /drivers/mmc/host/tmio_mmc.c
parentmmc: sh_mmcif: remove redundant initialization of 'opc' (diff)
downloadkernel-qcow2-linux-8d09a13386ccdee8fb6d66aa2cfedbbc9255f892.tar.gz
kernel-qcow2-linux-8d09a13386ccdee8fb6d66aa2cfedbbc9255f892.tar.xz
kernel-qcow2-linux-8d09a13386ccdee8fb6d66aa2cfedbbc9255f892.zip
mmc: tmio: ioremap memory resource in tmio_mmc_host_alloc()
The register region is ioremap'ed in the tmio_mmc_host_probe(), i.e. drivers cannot get access to the hardware before mmc_add_host(). Actually, renesas_sdhi_core.c reads out the CTL_VERSION register to complete the platform-specific settings. However, at this point, the MMC host is already running. Move the register ioremap to tmio_mmc_host_alloc() so that drivers can perform platform-specific settings between tmio_mmc_host_alloc() and tmio_mmc_host_probe(). I changed tmio_mmc_host_alloc() to return an error pointer to propagate the return code from devm_ioremap_resource(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com> 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.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index ccfbc154ee5b..d660816bdf89 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -93,8 +93,10 @@ static int tmio_mmc_probe(struct platform_device *pdev)
pdata->flags |= TMIO_MMC_HAVE_HIGH_REG;
host = tmio_mmc_host_alloc(pdev);
- if (!host)
+ if (IS_ERR(host)) {
+ ret = PTR_ERR(host);
goto cell_disable;
+ }
/* SD control register space size is 0x200, 0x400 for bus_shift=1 */
host->bus_shift = resource_size(res) >> 10;