mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-22 22:51:37 +00:00
rtc: 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: Thierry Reding <thierry.reding@avionic-design.de> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Cc: Alessandro Zummo <a.zummo@towertech.it> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
6d4294d163
commit
8cbce1e5f0
4 changed files with 12 additions and 18 deletions
|
@ -486,11 +486,9 @@ static int s3c_rtc_probe(struct platform_device *pdev)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
s3c_rtc_base = devm_request_and_ioremap(&pdev->dev, res);
|
s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (s3c_rtc_base == NULL) {
|
if (IS_ERR(s3c_rtc_base))
|
||||||
dev_err(&pdev->dev, "failed to ioremap memory region\n");
|
return PTR_ERR(s3c_rtc_base);
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
rtc_clk = devm_clk_get(&pdev->dev, "rtc");
|
rtc_clk = devm_clk_get(&pdev->dev, "rtc");
|
||||||
if (IS_ERR(rtc_clk)) {
|
if (IS_ERR(rtc_clk)) {
|
||||||
|
|
|
@ -252,9 +252,9 @@ static int snvs_rtc_probe(struct platform_device *pdev)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||||
data->ioaddr = devm_request_and_ioremap(&pdev->dev, res);
|
data->ioaddr = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!data->ioaddr)
|
if (IS_ERR(data->ioaddr))
|
||||||
return -EADDRNOTAVAIL;
|
return PTR_ERR(data->ioaddr);
|
||||||
|
|
||||||
data->irq = platform_get_irq(pdev, 0);
|
data->irq = platform_get_irq(pdev, 0);
|
||||||
if (data->irq < 0)
|
if (data->irq < 0)
|
||||||
|
|
|
@ -385,11 +385,9 @@ static int spear_rtc_probe(struct platform_device *pdev)
|
||||||
return status;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
config->ioaddr = devm_request_and_ioremap(&pdev->dev, res);
|
config->ioaddr = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!config->ioaddr) {
|
if (IS_ERR(config->ioaddr))
|
||||||
dev_err(&pdev->dev, "request-ioremap fail\n");
|
return PTR_ERR(config->ioaddr);
|
||||||
return -ENOMEM;
|
|
||||||
}
|
|
||||||
|
|
||||||
config->clk = devm_clk_get(&pdev->dev, NULL);
|
config->clk = devm_clk_get(&pdev->dev, NULL);
|
||||||
if (IS_ERR(config->clk))
|
if (IS_ERR(config->clk))
|
||||||
|
|
|
@ -327,11 +327,9 @@ static int tegra_rtc_probe(struct platform_device *pdev)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->rtc_base = devm_request_and_ioremap(&pdev->dev, res);
|
info->rtc_base = devm_ioremap_resource(&pdev->dev, res);
|
||||||
if (!info->rtc_base) {
|
if (IS_ERR(info->rtc_base))
|
||||||
dev_err(&pdev->dev, "Unable to request mem region and grab IOs for device.\n");
|
return PTR_ERR(info->rtc_base);
|
||||||
return -EBUSY;
|
|
||||||
}
|
|
||||||
|
|
||||||
info->tegra_rtc_irq = platform_get_irq(pdev, 0);
|
info->tegra_rtc_irq = platform_get_irq(pdev, 0);
|
||||||
if (info->tegra_rtc_irq <= 0)
|
if (info->tegra_rtc_irq <= 0)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue