From: Luc Verhaegen <[email protected]>

While at it update ioremap_wc error return from ENODEV to ENOMEM.

Signed-off-by: Luc Verhaegen <[email protected]>
Acked-by: Stephen Warren <[email protected]>
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
Acked-by: Geert Uytterhoeven <[email protected]>
Reviewed-by: Maxime Ripard <[email protected]>
Reviewed-by: David Herrmann <[email protected]>
---
 drivers/video/fbdev/simplefb.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/drivers/video/fbdev/simplefb.c b/drivers/video/fbdev/simplefb.c
index ec112c1..cdcf1fe 100644
--- a/drivers/video/fbdev/simplefb.c
+++ b/drivers/video/fbdev/simplefb.c
@@ -220,8 +220,8 @@ static int simplefb_probe(struct platform_device *pdev)
 
        info->apertures = alloc_apertures(1);
        if (!info->apertures) {
-               framebuffer_release(info);
-               return -ENOMEM;
+               ret = -ENOMEM;
+               goto error_fb_release;
        }
        info->apertures->ranges[0].base = info->fix.smem_start;
        info->apertures->ranges[0].size = info->fix.smem_len;
@@ -231,8 +231,8 @@ static int simplefb_probe(struct platform_device *pdev)
        info->screen_base = ioremap_wc(info->fix.smem_start,
                                       info->fix.smem_len);
        if (!info->screen_base) {
-               framebuffer_release(info);
-               return -ENODEV;
+               ret = -ENOMEM;
+               goto error_fb_release;
        }
        info->pseudo_palette = par->palette;
 
@@ -247,14 +247,18 @@ static int simplefb_probe(struct platform_device *pdev)
        ret = register_framebuffer(info);
        if (ret < 0) {
                dev_err(&pdev->dev, "Unable to register simplefb: %d\n", ret);
-               iounmap(info->screen_base);
-               framebuffer_release(info);
-               return ret;
+               goto error_unmap;
        }
 
        dev_info(&pdev->dev, "fb%d: simplefb registered!\n", info->node);
 
        return 0;
+
+error_unmap:
+       iounmap(info->screen_base);
+error_fb_release:
+       framebuffer_release(info);
+       return ret;
 }
 
 static int simplefb_remove(struct platform_device *pdev)
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to