]> git.karo-electronics.de Git - linux-beck.git/commitdiff
mfd: omap-usb-host: Convert to devm_ioremap_resource()
authorSachin Kamat <sachin.kamat@linaro.org>
Tue, 9 Apr 2013 10:46:36 +0000 (16:16 +0530)
committerSamuel Ortiz <sameo@linux.intel.com>
Tue, 9 Apr 2013 13:01:31 +0000 (15:01 +0200)
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() 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: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Roger Quadros <rogerq@ti.com>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
drivers/mfd/omap-usb-host.c

index d3b6e9491b624a1b7860dc84392ed8b3f72e8105..759fae3ca7fb0dba592ab808d036f889bf96f922 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/pm_runtime.h>
 #include <linux/of.h>
 #include <linux/of_platform.h>
+#include <linux/err.h>
 
 #include "omap-usb.h"
 
@@ -608,11 +609,9 @@ static int usbhs_omap_probe(struct platform_device *pdev)
        }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       omap->uhh_base = devm_request_and_ioremap(dev, res);
-       if (!omap->uhh_base) {
-               dev_err(dev, "Resource request/ioremap failed\n");
-               return -EADDRNOTAVAIL;
-       }
+       omap->uhh_base = devm_ioremap_resource(dev, res);
+       if (IS_ERR(omap->uhh_base))
+               return PTR_ERR(omap->uhh_base);
 
        omap->pdata = pdata;