]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
amba: Convert to devm_ioremap_resource()
authorThierry Reding <thierry.reding@avionic-design.de>
Mon, 21 Jan 2013 10:08:57 +0000 (11:08 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 25 Jan 2013 20:21:46 +0000 (12:21 -0800)
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>
Cc: Russell King <linux@arm.linux.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/amba/tegra-ahb.c

index 536c166f4253eac9b8bcdf4b9c71c45c35b18b45..ab92785f54dccaed562b8f9310f46c5f2b30cc80 100644 (file)
@@ -20,6 +20,7 @@
  *
  */
 
+#include <linux/err.h>
 #include <linux/kernel.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
@@ -257,9 +258,9 @@ static int tegra_ahb_probe(struct platform_device *pdev)
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
                return -ENODEV;
-       ahb->regs = devm_request_and_ioremap(&pdev->dev, res);
-       if (!ahb->regs)
-               return -EBUSY;
+       ahb->regs = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(ahb->regs))
+               return PTR_ERR(ahb->regs);
 
        ahb->dev = &pdev->dev;
        platform_set_drvdata(pdev, ahb);