OMAP: DSS2: OMAPFB: Fix probe error path
authorAfzal Mohammed <lazfamam@gmail.com>
Thu, 1 Jul 2010 13:40:01 +0000 (15:40 +0200)
committerTomi Valkeinen <tomi.valkeinen@nokia.com>
Thu, 5 Aug 2010 13:52:15 +0000 (16:52 +0300)
Move sysfs entry creation to omapfb_probe() from omapfb_create_framebuffers().
This will make sure that sysfs entry is not left behind in case of unsuccessful
probe due to failure in enabling fb0 of omapfb_create_framebuffers().

Signed-off-by: Afzal Mohammed <lazfamam@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@nokia.com>
drivers/video/omap2/omapfb/omapfb-main.c

index 4abb1d17231b2c0c393baa0d2ac8343c127fd18b..e51b7bf64307bed03ad0c284888badc9ae801ff8 100644 (file)
@@ -2005,13 +2005,6 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
                }
        }
 
-       DBG("create sysfs for fbs\n");
-       r = omapfb_create_sysfs(fbdev);
-       if (r) {
-               dev_err(fbdev->dev, "failed to create sysfs entries\n");
-               return r;
-       }
-
        /* Enable fb0 */
        if (fbdev->num_fbs > 0) {
                struct omapfb_info *ofbi = FB2OFB(fbdev->fbs[0]);
@@ -2297,6 +2290,13 @@ static int omapfb_probe(struct platform_device *pdev)
                }
        }
 
+       DBG("create sysfs for fbs\n");
+       r = omapfb_create_sysfs(fbdev);
+       if (r) {
+               dev_err(fbdev->dev, "failed to create sysfs entries\n");
+               goto cleanup;
+       }
+
        return 0;
 
 cleanup: