Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Balaji T K and committed by
Chris Ball
77fae219 9fa0e05e

+5 -14
+5 -14
drivers/mmc/host/omap_hsmmc.c
··· 1851 1851 unsigned tx_req, rx_req; 1852 1852 struct pinctrl *pinctrl; 1853 1853 const struct omap_mmc_of_data *data; 1854 + void __iomem *base; 1854 1855 1855 1856 match = of_match_device(of_match_ptr(omap_mmc_of_match), &pdev->dev); 1856 1857 if (match) { ··· 1882 1881 if (res == NULL || irq < 0) 1883 1882 return -ENXIO; 1884 1883 1885 - res = request_mem_region(res->start, resource_size(res), pdev->name); 1886 - if (res == NULL) 1887 - return -EBUSY; 1884 + base = devm_ioremap_resource(&pdev->dev, res); 1885 + if (IS_ERR(base)) 1886 + return PTR_ERR(base); 1888 1887 1889 1888 ret = omap_hsmmc_gpio_init(pdata); 1890 1889 if (ret) ··· 1905 1904 host->irq = irq; 1906 1905 host->slot_id = 0; 1907 1906 host->mapbase = res->start + pdata->reg_offset; 1908 - host->base = ioremap(host->mapbase, SZ_4K); 1907 + host->base = base + pdata->reg_offset; 1909 1908 host->power_mode = MMC_POWER_OFF; 1910 1909 host->next_data.cookie = 1; 1911 1910 host->pbias_enabled = 0; ··· 2105 2104 if (host->dbclk) 2106 2105 clk_disable_unprepare(host->dbclk); 2107 2106 err1: 2108 - iounmap(host->base); 2109 2107 mmc_free_host(mmc); 2110 2108 err_alloc: 2111 2109 omap_hsmmc_gpio_free(pdata); 2112 2110 err: 2113 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2114 - if (res) 2115 - release_mem_region(res->start, resource_size(res)); 2116 2111 return ret; 2117 2112 } 2118 2113 2119 2114 static int omap_hsmmc_remove(struct platform_device *pdev) 2120 2115 { 2121 2116 struct omap_hsmmc_host *host = platform_get_drvdata(pdev); 2122 - struct resource *res; 2123 2117 2124 2118 pm_runtime_get_sync(host->dev); 2125 2119 mmc_remove_host(host->mmc); ··· 2134 2138 clk_disable_unprepare(host->dbclk); 2135 2139 2136 2140 omap_hsmmc_gpio_free(host->pdata); 2137 - iounmap(host->base); 2138 2141 mmc_free_host(host->mmc); 2139 - 2140 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 2141 - if (res) 2142 - release_mem_region(res->start, resource_size(res)); 2143 2142 2144 2143 return 0; 2145 2144 }