aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBalaji T K <balajitk@ti.com>2014-05-09 12:46:51 -0400
committerChris Ball <chris@printf.net>2014-05-22 08:40:43 -0400
commit77fae21987fc5cb331029367eb04ad3d0e737050 (patch)
treeb4fb1583be16a3edec2aa270b23c0c6ee0105a98
parent9fa0e05e06d1ab0a2e3bd1e01e71a04f2c520b85 (diff)
mmc: omap_hsmmc: use devm_ioremap_resource
With devm_ioremap_resource conversion release_mem_region, iounmap can be removed in clean up path Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> Signed-off-by: Chris Ball <chris@printf.net>
-rw-r--r--drivers/mmc/host/omap_hsmmc.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/drivers/mmc/host/omap_hsmmc.c b/drivers/mmc/host/omap_hsmmc.c
index 6179fe3ef8ca..140425c215ad 100644
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1851,6 +1851,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1851 unsigned tx_req, rx_req; 1851 unsigned tx_req, rx_req;
1852 struct pinctrl *pinctrl; 1852 struct pinctrl *pinctrl;
1853 const struct omap_mmc_of_data *data; 1853 const struct omap_mmc_of_data *data;
1854 void __iomem *base;
1854 1855
1855 match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev); 1856 match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev);
1856 if (match) { 1857 if (match) {
@@ -1881,9 +1882,9 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1881 if (res == NULL || irq < 0) 1882 if (res == NULL || irq < 0)
1882 return -ENXIO; 1883 return -ENXIO;
1883 1884
1884 res = request_mem_region(res->start, resource_size(res), pdev->name); 1885 base = devm_ioremap_resource(&pdev->dev, res);
1885 if (res == NULL) 1886 if (IS_ERR(base))
1886 return -EBUSY; 1887 return PTR_ERR(base);
1887 1888
1888 ret = omap_hsmmc_gpio_init(pdata); 1889 ret = omap_hsmmc_gpio_init(pdata);
1889 if (ret) 1890 if (ret)
@@ -1904,7 +1905,7 @@ static int omap_hsmmc_probe(struct platform_device *pdev)
1904 host->irq = irq; 1905 host->irq = irq;
1905 host->slot_id = 0; 1906 host->slot_id = 0;
1906 host->mapbase = res->start + pdata->reg_offset; 1907 host->mapbase = res->start + pdata->reg_offset;
1907 host->base = ioremap(host->mapbase, SZ_4K); 1908 host->base = base + pdata->reg_offset;
1908 host->power_mode = MMC_POWER_OFF; 1909 host->power_mode = MMC_POWER_OFF;
1909 host->next_data.cookie = 1; 1910 host->next_data.cookie = 1;
1910 host->pbias_enabled = 0; 1911 host->pbias_enabled = 0;
@@ -2104,21 +2105,16 @@ err_irq:
2104 if (host->dbclk) 2105 if (host->dbclk)
2105 clk_disable_unprepare(host->dbclk); 2106 clk_disable_unprepare(host->dbclk);
2106err1: 2107err1:
2107 iounmap(host->base);
2108 mmc_free_host(mmc); 2108 mmc_free_host(mmc);
2109err_alloc: 2109err_alloc:
2110 omap_hsmmc_gpio_free(pdata); 2110 omap_hsmmc_gpio_free(pdata);
2111err: 2111err:
2112 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2113 if (res)
2114 release_mem_region(res->start, resource_size(res));
2115 return ret; 2112 return ret;
2116} 2113}
2117 2114
2118static int omap_hsmmc_remove(struct platform_device *pdev) 2115static int omap_hsmmc_remove(struct platform_device *pdev)
2119{ 2116{
2120 struct omap_hsmmc_host *host = platform_get_drvdata(pdev); 2117 struct omap_hsmmc_host *host = platform_get_drvdata(pdev);
2121 struct resource *res;
2122 2118
2123 pm_runtime_get_sync(host->dev); 2119 pm_runtime_get_sync(host->dev);
2124 mmc_remove_host(host->mmc); 2120 mmc_remove_host(host->mmc);
@@ -2138,13 +2134,8 @@ static int omap_hsmmc_remove(struct platform_device *pdev)
2138 clk_disable_unprepare(host->dbclk); 2134 clk_disable_unprepare(host->dbclk);
2139 2135
2140 omap_hsmmc_gpio_free(host->pdata); 2136 omap_hsmmc_gpio_free(host->pdata);
2141 iounmap(host->base);
2142 mmc_free_host(host->mmc); 2137 mmc_free_host(host->mmc);
2143 2138
2144 res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
2145 if (res)
2146 release_mem_region(res->start, resource_size(res));
2147
2148 return 0; 2139 return 0;
2149} 2140}
2150 2141