summaryrefslogtreecommitdiff
path: root/drivers/mmc
diff options
context:
space:
mode:
authorBeomho Seo <beomho.seo@samsung.com>2013-12-03 17:25:13 +0900
committerMarek Szyprowski <m.szyprowski@samsung.com>2014-05-15 07:25:39 +0200
commitd1f0ac78df607c7b4cc2946701dda2b42d59f3bd (patch)
tree037561dc35678d24c3e1a41a60f619e3da7756e7 /drivers/mmc
parent0360bd18590d0d0df3c09c2d1a2f1c0cc83795fc (diff)
downloadlinux-3.10-d1f0ac78df607c7b4cc2946701dda2b42d59f3bd.tar.gz
linux-3.10-d1f0ac78df607c7b4cc2946701dda2b42d59f3bd.tar.bz2
linux-3.10-d1f0ac78df607c7b4cc2946701dda2b42d59f3bd.zip
mmc: sdhci-pltfm: Use devm_ioremap_resource()
This patch devm_ioremap_resource for replace request region and ioremap. Change-Id: I6b63e1db0d0c9d6d8cf89a93d57db0b253418e3a Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Diffstat (limited to 'drivers/mmc')
-rw-r--r--drivers/mmc/host/sdhci-pltfm.c23
1 files changed, 4 insertions, 19 deletions
diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index cd0f1f68e26..be90c47fad8 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -154,18 +154,10 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,
host->quirks = pdata->quirks;
host->irq = platform_get_irq(pdev, 0);
- if (!request_mem_region(iomem->start, resource_size(iomem),
- mmc_hostname(host->mmc))) {
- dev_err(&pdev->dev, "cannot request region\n");
- ret = -EBUSY;
- goto err_request;
- }
-
- host->ioaddr = ioremap(iomem->start, resource_size(iomem));
- if (!host->ioaddr) {
- dev_err(&pdev->dev, "failed to remap registers\n");
- ret = -ENOMEM;
- goto err_remap;
+ host->ioaddr = devm_ioremap_resource(&pdev->dev, iomem);
+ if (IS_ERR(host->ioaddr)) {
+ ret = PTR_ERR(host->ioaddr);
+ goto err;
}
/*
@@ -179,10 +171,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:
dev_err(&pdev->dev, "%s failed %d\n", __func__, ret);
return ERR_PTR(ret);
@@ -192,10 +180,7 @@ 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);
platform_set_drvdata(pdev, NULL);
}