All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH Resend 2/2] mmc: sdhci-pltfm: Use devm_ioremap_resource()
@ 2013-11-28 11:24 Beomho Seo
  0 siblings, 0 replies; only message in thread
From: Beomho Seo @ 2013-11-28 11:24 UTC (permalink / raw)
  To: cjb; +Cc: linux-mmc, myungjoo.ham, jh80.chung, heiko

Use devm_ioremap_resource for replace request region and ioremap.

Signed-off-by: Beomho Seo <beomho.seo@samsung.com>
Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/host/sdhci-pltfm.c |   23 ++++-------------------
 1 file changed, 4 insertions(+), 19 deletions(-)

diff --git a/drivers/mmc/host/sdhci-pltfm.c b/drivers/mmc/host/sdhci-pltfm.c
index e2065a4..3e6c25c 100644
--- a/drivers/mmc/host/sdhci-pltfm.c
+++ b/drivers/mmc/host/sdhci-pltfm.c
@@ -157,18 +157,10 @@ struct sdhci_host *sdhci_pltfm_init(struct platform_device *pdev,

 	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;
 	}

 	/*
@@ -182,10 +174,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);
@@ -195,10 +183,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);
 }
 EXPORT_SYMBOL_GPL(sdhci_pltfm_free);
-- 
1.7.9.5

-- 
Best Regards,

Beomho Seo

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2013-11-28 11:24 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-28 11:24 [PATCH Resend 2/2] mmc: sdhci-pltfm: Use devm_ioremap_resource() Beomho Seo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.