diff options
author | Thierry Reding <thierry.reding@avionic-design.de> | 2013-01-21 05:09:17 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-01-22 14:41:57 -0500 |
commit | 8cbce1e5f00ec68ee1c99f57db98c892db227629 (patch) | |
tree | 34bab927b431a710117e8492b08fe30c16280c7a | |
parent | 6d4294d1634543853febc4287ecf02998fd234e1 (diff) |
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>
-rw-r--r-- | drivers/rtc/rtc-s3c.c | 8 | ||||
-rw-r--r-- | drivers/rtc/rtc-snvs.c | 6 | ||||
-rw-r--r-- | drivers/rtc/rtc-spear.c | 8 | ||||
-rw-r--r-- | drivers/rtc/rtc-tegra.c | 8 |
4 files changed, 12 insertions, 18 deletions
diff --git a/drivers/rtc/rtc-s3c.c b/drivers/rtc/rtc-s3c.c index 404651464d45..0c397ac3b132 100644 --- a/drivers/rtc/rtc-s3c.c +++ b/drivers/rtc/rtc-s3c.c | |||
@@ -486,11 +486,9 @@ static int s3c_rtc_probe(struct platform_device *pdev) | |||
486 | return -ENOENT; | 486 | return -ENOENT; |
487 | } | 487 | } |
488 | 488 | ||
489 | s3c_rtc_base = devm_request_and_ioremap(&pdev->dev, res); | 489 | s3c_rtc_base = devm_ioremap_resource(&pdev->dev, res); |
490 | if (s3c_rtc_base == NULL) { | 490 | if (IS_ERR(s3c_rtc_base)) |
491 | dev_err(&pdev->dev, "failed to ioremap memory region\n"); | 491 | return PTR_ERR(s3c_rtc_base); |
492 | return -EINVAL; | ||
493 | } | ||
494 | 492 | ||
495 | rtc_clk = devm_clk_get(&pdev->dev, "rtc"); | 493 | rtc_clk = devm_clk_get(&pdev->dev, "rtc"); |
496 | if (IS_ERR(rtc_clk)) { | 494 | if (IS_ERR(rtc_clk)) { |
diff --git a/drivers/rtc/rtc-snvs.c b/drivers/rtc/rtc-snvs.c index d5ec7854a651..40662e9dc0ab 100644 --- a/drivers/rtc/rtc-snvs.c +++ b/drivers/rtc/rtc-snvs.c | |||
@@ -252,9 +252,9 @@ static int snvs_rtc_probe(struct platform_device *pdev) | |||
252 | return -ENOMEM; | 252 | return -ENOMEM; |
253 | 253 | ||
254 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 254 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
255 | data->ioaddr = devm_request_and_ioremap(&pdev->dev, res); | 255 | data->ioaddr = devm_ioremap_resource(&pdev->dev, res); |
256 | if (!data->ioaddr) | 256 | if (IS_ERR(data->ioaddr)) |
257 | return -EADDRNOTAVAIL; | 257 | return PTR_ERR(data->ioaddr); |
258 | 258 | ||
259 | data->irq = platform_get_irq(pdev, 0); | 259 | data->irq = platform_get_irq(pdev, 0); |
260 | if (data->irq < 0) | 260 | if (data->irq < 0) |
diff --git a/drivers/rtc/rtc-spear.c b/drivers/rtc/rtc-spear.c index c2121b5a01f2..a18c3192ed40 100644 --- a/drivers/rtc/rtc-spear.c +++ b/drivers/rtc/rtc-spear.c | |||
@@ -385,11 +385,9 @@ static int spear_rtc_probe(struct platform_device *pdev) | |||
385 | return status; | 385 | return status; |
386 | } | 386 | } |
387 | 387 | ||
388 | config->ioaddr = devm_request_and_ioremap(&pdev->dev, res); | 388 | config->ioaddr = devm_ioremap_resource(&pdev->dev, res); |
389 | if (!config->ioaddr) { | 389 | if (IS_ERR(config->ioaddr)) |
390 | dev_err(&pdev->dev, "request-ioremap fail\n"); | 390 | return PTR_ERR(config->ioaddr); |
391 | return -ENOMEM; | ||
392 | } | ||
393 | 391 | ||
394 | config->clk = devm_clk_get(&pdev->dev, NULL); | 392 | config->clk = devm_clk_get(&pdev->dev, NULL); |
395 | if (IS_ERR(config->clk)) | 393 | if (IS_ERR(config->clk)) |
diff --git a/drivers/rtc/rtc-tegra.c b/drivers/rtc/rtc-tegra.c index c84ea6659f49..7c033756d6b5 100644 --- a/drivers/rtc/rtc-tegra.c +++ b/drivers/rtc/rtc-tegra.c | |||
@@ -327,11 +327,9 @@ static int tegra_rtc_probe(struct platform_device *pdev) | |||
327 | return -EBUSY; | 327 | return -EBUSY; |
328 | } | 328 | } |
329 | 329 | ||
330 | info->rtc_base = devm_request_and_ioremap(&pdev->dev, res); | 330 | info->rtc_base = devm_ioremap_resource(&pdev->dev, res); |
331 | if (!info->rtc_base) { | 331 | if (IS_ERR(info->rtc_base)) |
332 | dev_err(&pdev->dev, "Unable to request mem region and grab IOs for device.\n"); | 332 | return PTR_ERR(info->rtc_base); |
333 | return -EBUSY; | ||
334 | } | ||
335 | 333 | ||
336 | info->tegra_rtc_irq = platform_get_irq(pdev, 0); | 334 | info->tegra_rtc_irq = platform_get_irq(pdev, 0); |
337 | if (info->tegra_rtc_irq <= 0) | 335 | if (info->tegra_rtc_irq <= 0) |