summaryrefslogtreecommitdiff
path: root/drivers/mmc/host/sdhci-pltfm.c
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.masahiro@socionext.com>2016-04-20 05:16:27 +0300
committerUlf Hansson <ulf.hansson@linaro.org>2016-05-02 11:33:32 +0300
commite95f644d8b112647a8da5314e5e93b59ac8d3f08 (patch)
tree1b47269610bcebb3b64094481cf34fd7545d9bfe /drivers/mmc/host/sdhci-pltfm.c
parent0a782cb1fc2407163123fccd01f65da70d4d2cd8 (diff)
downloadlinux-e95f644d8b112647a8da5314e5e93b59ac8d3f08.tar.xz
mmc: sdhci-pltfm: use devm_request_mem_region()
Use the managed variant of request_mem_region(). Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Acked-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Diffstat (limited to 'drivers/mmc/host/sdhci-pltfm.c')
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index 24377a34db41..8527a7cfd486 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -152,8 +152,9 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
goto err_request;
}
- if (!request_mem_region(iomem->start, resource_size(iomem),
- mmc_hostname(host->mmc))) {
+ if (!devm_request_mem_region(&pdev->dev, iomem->start,
+ resource_size(iomem),
+ mmc_hostname(host->mmc))) {
dev_err(&pdev->dev, "cannot request region\n");
ret = -EBUSY;
goto err_request;
@@ -163,7 +164,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
if (!host->ioaddr) {
dev_err(&pdev->dev, "failed to remap registers\n");
ret = -ENOMEM;
- goto err_remap;
+ goto err_request;
}
/*
@@ -177,8 +178,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
return host;
-err_remap:
- release_mem_region(iomem->start, resource_size(iomem));
err_request:
sdhci_free_host(host);
err:
@@ -190,10 +189,8 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_init);
void sdhci_pltfm_free(struct platform_device *pdev)
{
struct sdhci_host *host = platform_get_drvdata(pdev);
- struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iounmap(host->ioaddr);
- release_mem_region(iomem->start, resource_size(iomem));
sdhci_free_host(host);
}
EXPORT_SYMBOL_GPL(sdhci_pltfm_free);