video: wm8505fb: Convert to devm_ioremap_resource()
authorSachin Kamat <sachin.kamat@linaro.org>
Mon, 8 Apr 2013 10:04:00 +0000 (13:04 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Wed, 10 Apr 2013 08:15:49 +0000 (11:15 +0300)
Use the newly introduced devm_ioremap_resource() instead of
devm_request_and_ioremap() which provides more consistent error handling.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Acked-by: Tony Prisk <linux@prisktech.co.nz>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/wm8505fb.c

index 19e2e7ff492aa62b1a37afa3252fcc3a4b78feae..01f9ace068e20e6de2979fb8740a454b699ef73c 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/dma-mapping.h>
 #include <linux/fb.h>
 #include <linux/errno.h>
+#include <linux/err.h>
 #include <linux/init.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
@@ -303,9 +304,9 @@ static int wm8505fb_probe(struct platform_device *pdev)
        fbi->fb.pseudo_palette  = addr;
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       fbi->regbase = devm_request_and_ioremap(&pdev->dev, res);
-       if (fbi->regbase == NULL)
-               return -EBUSY;
+       fbi->regbase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(fbi->regbase))
+               return PTR_ERR(fbi->regbase);
 
        disp_timing = of_get_display_timings(pdev->dev.of_node);
        if (!disp_timing)