Commit e95f644d authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Ulf Hansson

mmc: sdhci-pltfm: use devm_request_mem_region()

Use the managed variant of request_mem_region().
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: default avatarAdrian Hunter <adrian.hunter@intel.com>
Signed-off-by: default avatarUlf Hansson <ulf.hansson@linaro.org>
parent 0a782cb1
...@@ -152,7 +152,8 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, ...@@ -152,7 +152,8 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
goto err_request; goto err_request;
} }
if (!request_mem_region(iomem->start, resource_size(iomem), if (!devm_request_mem_region(&pdev->dev, iomem->start,
resource_size(iomem),
mmc_hostname(host->mmc))) { mmc_hostname(host->mmc))) {
dev_err(&pdev->dev, "cannot request region\n"); dev_err(&pdev->dev, "cannot request region\n");
ret = -EBUSY; ret = -EBUSY;
...@@ -163,7 +164,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, ...@@ -163,7 +164,7 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
if (!host->ioaddr) { if (!host->ioaddr) {
dev_err(&pdev->dev, "failed to remap registers\n"); dev_err(&pdev->dev, "failed to remap registers\n");
ret = -ENOMEM; ret = -ENOMEM;
goto err_remap; goto err_request;
} }
/* /*
...@@ -177,8 +178,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev, ...@@ -177,8 +178,6 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
return host; return host;
err_remap:
release_mem_region(iomem->start, resource_size(iomem));
err_request: err_request:
sdhci_free_host(host); sdhci_free_host(host);
err: err:
...@@ -190,10 +189,8 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_init); ...@@ -190,10 +189,8 @@ EXPORT_SYMBOL_GPL(sdhci_pltfm_init);
void sdhci_pltfm_free(struct platform_device *pdev) void sdhci_pltfm_free(struct platform_device *pdev)
{ {
struct sdhci_host *host = platform_get_drvdata(pdev); struct sdhci_host *host = platform_get_drvdata(pdev);
struct resource *iomem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
iounmap(host->ioaddr); iounmap(host->ioaddr);
release_mem_region(iomem->start, resource_size(iomem));
sdhci_free_host(host); sdhci_free_host(host);
} }
EXPORT_SYMBOL_GPL(sdhci_pltfm_free); EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment