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

ARM: 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.
Signed-off-by: NThierry Reding <thierry.reding@avionic-design.de>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 84dbf809
...@@ -1134,11 +1134,9 @@ static int gpmc_probe(struct platform_device *pdev) ...@@ -1134,11 +1134,9 @@ static int gpmc_probe(struct platform_device *pdev)
phys_base = res->start; phys_base = res->start;
mem_size = resource_size(res); mem_size = resource_size(res);
gpmc_base = devm_request_and_ioremap(&pdev->dev, res); gpmc_base = devm_ioremap_resource(&pdev->dev, res);
if (!gpmc_base) { if (IS_ERR(gpmc_base))
dev_err(&pdev->dev, "error: request memory / ioremap\n"); return PTR_ERR(gpmc_base);
return -EADDRNOTAVAIL;
}
res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); res = platform_get_resource(pdev, IORESOURCE_IRQ, 0);
if (res == NULL) if (res == NULL)
......
...@@ -312,11 +312,9 @@ static int tegra_emc_probe(struct platform_device *pdev) ...@@ -312,11 +312,9 @@ static int tegra_emc_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
emc_regbase = devm_request_and_ioremap(&pdev->dev, res); emc_regbase = devm_ioremap_resource(&pdev->dev, res);
if (!emc_regbase) { if (IS_ERR(emc_regbase))
dev_err(&pdev->dev, "failed to remap registers\n"); return PTR_ERR(emc_regbase);
return -ENOMEM;
}
pdata = pdev->dev.platform_data; pdata = pdev->dev.platform_data;
......
...@@ -808,11 +808,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev) ...@@ -808,11 +808,9 @@ static int omap_dm_timer_probe(struct platform_device *pdev)
return -ENOMEM; return -ENOMEM;
} }
timer->io_base = devm_request_and_ioremap(dev, mem); timer->io_base = devm_ioremap_resource(dev, mem);
if (!timer->io_base) { if (IS_ERR(timer->io_base))
dev_err(dev, "%s: region already claimed.\n", __func__); return PTR_ERR(timer->io_base);
return -ENOMEM;
}
if (dev->of_node) { if (dev->of_node) {
if (of_find_property(dev->of_node, "ti,timer-alwon", NULL)) if (of_find_property(dev->of_node, "ti,timer-alwon", NULL))
......
...@@ -386,11 +386,9 @@ static int s3c_adc_probe(struct platform_device *pdev) ...@@ -386,11 +386,9 @@ static int s3c_adc_probe(struct platform_device *pdev)
return -ENXIO; return -ENXIO;
} }
adc->regs = devm_request_and_ioremap(dev, regs); adc->regs = devm_ioremap_resource(dev, regs);
if (!adc->regs) { if (IS_ERR(adc->regs))
dev_err(dev, "failed to map registers\n"); return PTR_ERR(adc->regs);
return -ENXIO;
}
ret = regulator_enable(adc->vdd); ret = regulator_enable(adc->vdd);
if (ret) if (ret)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册