* [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path
@ 2010-06-30 14:15 Afzal Mohammed
2010-07-01 9:54 ` Tomi Valkeinen
0 siblings, 1 reply; 5+ messages in thread
From: Afzal Mohammed @ 2010-06-30 14:15 UTC (permalink / raw)
To: tomi.valkeinen
Cc: ville.syrjala, tj, lazfamam, linux-omap, linux-fbdev, linux-kernel
If enabling fb0 fails in omapfb_create_framebuffers(), remove
sysfs file before returning to probe. This is required to complete
the cleanup in the above mentioned error case.
Signed-off-by: Afzal Mohammed <lazfamam@gmail.com>
---
drivers/video/omap2/omapfb/omapfb-main.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/drivers/video/omap2/omapfb/omapfb-main.c b/drivers/video/omap2/omapfb/omapfb-main.c
index 4b4506d..2319b81 100644
--- a/drivers/video/omap2/omapfb/omapfb-main.c
+++ b/drivers/video/omap2/omapfb/omapfb-main.c
@@ -1945,6 +1945,7 @@ static int omapfb_create_framebuffers(struct omapfb2_device *fbdev)
r = omapfb_overlay_enable(ovl, 1);
if (r) {
+ omapfb_remove_sysfs(fbdev);
dev_err(fbdev->dev,
"failed to enable overlay\n");
return r;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path
2010-06-30 14:15 [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path Afzal Mohammed
@ 2010-07-01 9:54 ` Tomi Valkeinen
0 siblings, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2010-07-01 9:54 UTC (permalink / raw)
To: ext Afzal Mohammed
Cc: Syrjala Ville (Nokia-D/Helsinki),
tj, linux-omap, linux-fbdev, linux-kernel
Hi,
On Wed, 2010-06-30 at 16:15 +0200, ext Afzal Mohammed wrote:
> If enabling fb0 fails in omapfb_create_framebuffers(), remove
> sysfs file before returning to probe. This is required to complete
> the cleanup in the above mentioned error case.
omapfb frees the resources in omapfb_free_resources(). I believe
removing sysfs should also be put into omapfb_free_resources() to be
consistent, and not as an explicit call like in this patch.
However, I'm not sure if some sysfs-allocated flag is needed for this to
work in all cases.
Tomi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path
2010-07-01 13:40 ` Afzal Mohammed
@ 2010-07-01 14:57 ` Tomi Valkeinen
0 siblings, 0 replies; 5+ messages in thread
From: Tomi Valkeinen @ 2010-07-01 14:57 UTC (permalink / raw)
To: ext Afzal Mohammed
Cc: Syrjala Ville (Nokia-MS/Helsinki),
tj, linux-omap, linux-fbdev, linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path
2010-07-01 13:40 Afzal Mohammed
@ 2010-07-01 13:40 ` Afzal Mohammed
2010-07-01 14:57 ` Tomi Valkeinen
0 siblings, 1 reply; 5+ messages in thread
From: Afzal Mohammed @ 2010-07-01 13:40 UTC (permalink / raw)
To: tomi.valkeinen
Cc: ville.syrjala, tj, lazfamam, linux-omap, linux-fbdev, linux-kernel
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>
---
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
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path
@ 2010-07-01 13:40 Afzal Mohammed
2010-07-01 13:40 ` Afzal Mohammed
0 siblings, 1 reply; 5+ messages in thread
From: Afzal Mohammed @ 2010-07-01 13:40 UTC (permalink / raw)
To: tomi.valkeinen
Cc: ville.syrjala, tj, lazfamam, linux-omap, linux-fbdev, linux-kernel
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
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-07-01 15:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-30 14:15 [PATCH] OMAP:DSS2:OMAPFB: Fix probe error path Afzal Mohammed
2010-07-01 9:54 ` Tomi Valkeinen
2010-07-01 13:40 Afzal Mohammed
2010-07-01 13:40 ` Afzal Mohammed
2010-07-01 14:57 ` Tomi Valkeinen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).