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:
Thierry Reding 2013-01-21 11:09:17 +01:00 committed by Greg Kroah-Hartman
parent 6d4294d163
commit 8cbce1e5f0
4 changed files with 12 additions and 18 deletions

View file

@ -486,11 +486,9 @@ static int s3c_rtc_probe(struct platform_device *pdev)
return -ENOENT;
}
s3c_rtc_base = devm_request_and_ioremap(&pdev->dev, res);
if (s3c_rtc_base == NULL) {
dev_err(&pdev->dev, "failed to ioremap memory region\n");
return -EINVAL;
}
s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res);
if (IS_ERR(s3c_rtc_base))
return PTR_ERR(s3c_rtc_base);
rtc_clk = devm_clk_get(&pdev->dev, "rtc");
if (IS_ERR(rtc_clk)) {