[PATCH] OMAP:DSS2:OMAPFB: Fix probe error path

STALE5957d

3 messages, 2 authors, 2010-07-01 · open the first message on its own page

[PATCH] OMAP:DSS2:OMAPFB: Fix probe error path

From: Afzal Mohammed <hidden>
Date: 2010-07-01 13:47:05

Hi Tomi,

Is this change ok instead of having sysfs entry removal in omapfb_free_resources() ?
Hope this change makes probe look more of a remove mirror.

Regards
Afzal

[PATCH] OMAP:DSS2:OMAPFB: Fix probe error path

From: Afzal Mohammed <hidden>
Date: 2010-07-01 13:40:53

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 <redacted>
---
 drivers/video/omap2/omapfb/omapfb-main.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 4b4506d..710e117 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1928,13 +1928,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]);
@@ -2220,6 +2213,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:
-- 
1.7.0.4

Re: [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path

From: Tomi Valkeinen <hidden>
Date: 2010-07-01 15:18:32

On Thu, 2010-07-01 at 15:40 +0200, ext Afzal Mohammed wrote:
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().
Yes, I think this version is ok. Thanks!

 Tomi

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help