提交 a3e2cd7f 编写于 作者: T Thierry Reding 提交者: Greg Kroah-Hartman

mmc: Convert to devm_ioremap_resource()

Convert all uses of devm_request_and_ioremap() to the newly introduced
devm_ioremap_resource() which provides more consistent error handling.

devm_ioremap_resource() provides its own error messages so all explicit
error messages can be removed from the failure code paths.
Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
Cc: Chris Ball <cjb@laptop.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 6c2db1c6
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
* (at your option) any later version. * (at your option) any later version.
*/ */
#include <linux/err.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/io.h> #include <linux/io.h>
...@@ -46,9 +47,9 @@ int dw_mci_pltfm_register(struct platform_device *pdev, ...@@ -46,9 +47,9 @@ int dw_mci_pltfm_register(struct platform_device *pdev,
host->dev = &pdev->dev; host->dev = &pdev->dev;
host->irq_flags = 0; host->irq_flags = 0;
host->pdata = pdev->dev.platform_data; host->pdata = pdev->dev.platform_data;
host->regs = devm_request_and_ioremap(&pdev->dev, regs); host->regs = devm_ioremap_resource(&pdev->dev, regs);
if (!host->regs) if (IS_ERR(host->regs))
return -ENOMEM; return PTR_ERR(host->regs);
if (drv_data && drv_data->init) { if (drv_data && drv_data->init) {
ret = drv_data->init(host); ret = drv_data->init(host);
......
...@@ -614,9 +614,9 @@ static int mxs_mmc_probe(struct platform_device *pdev) ...@@ -614,9 +614,9 @@ static int mxs_mmc_probe(struct platform_device *pdev)
host = mmc_priv(mmc); host = mmc_priv(mmc);
ssp = &host->ssp; ssp = &host->ssp;
ssp->dev = &pdev->dev; ssp->dev = &pdev->dev;
ssp->base = devm_request_and_ioremap(&pdev->dev, iores); ssp->base = devm_ioremap_resource(&pdev->dev, iores);
if (!ssp->base) { if (IS_ERR(ssp->base)) {
ret = -EADDRNOTAVAIL; ret = PTR_ERR(ssp->base);
goto out_mmc_free; goto out_mmc_free;
} }
......
...@@ -651,10 +651,9 @@ static int sdhci_s3c_probe(struct platform_device *pdev) ...@@ -651,10 +651,9 @@ static int sdhci_s3c_probe(struct platform_device *pdev)
#endif #endif
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
host->ioaddr = devm_request_and_ioremap(&pdev->dev, res); host->ioaddr = devm_ioremap_resource(&pdev->dev, res);
if (!host->ioaddr) { if (IS_ERR(host->ioaddr)) {
dev_err(dev, "failed to map registers\n"); ret = PTR_ERR(host->ioaddr);
ret = -ENXIO;
goto err_req_regs; goto err_req_regs;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册