Skip to contentSkip to conversation

fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

PATCH In review Chuhong Yuan 2 participants 2 messages Mar 24, 2020 – Apr 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v3 1/1 fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

The driver calls register_framebuffer() in probe but does not call unregister_framebuffer() in remove.
Rename current remove to __s1d13xxxfb_remove() for error handler. Then add a new remove to call unregister_framebuffer().

---
Changes in v3:
- Fix code style.
- Set __s1d13xxxfb_remove() to return void.
- Remove redundant check for info.

 drivers/video/fbdev/s1d13xxxfb.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/video/fbdev/s1d13xxxfb.c +11 -4
index 8048499e398d..d51ef7619115 100644
@@ -721,9 +721,7 @@ static void s1d13xxxfb_fetch_hw_state(struct fb_info *info)
 		xres, yres, xres_virtual, yres_virtual, is_color, is_dual, is_tft);
 }
 
-
-static int
-s1d13xxxfb_remove(struct platform_device *pdev)
+static void __s1d13xxxfb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 	struct s1d13xxxfb_par *par = NULL;
@@ -749,9 +747,18 @@ s1d13xxxfb_remove(struct platform_device *pdev)
 			pdev->resource[0].end - pdev->resource[0].start +1);
 	release_mem_region(pdev->resource[1].start,
 			pdev->resource[1].end - pdev->resource[1].start +1);
+}
+
+static int s1d13xxxfb_remove(struct platform_device *pdev)
+{
+	struct fb_info *info = platform_get_drvdata(pdev);
+
+	unregister_framebuffer(info);
+	__s1d13xxxfb_remove(pdev);
 	return 0;
 }
 
+
 static int s1d13xxxfb_probe(struct platform_device *pdev)
 {
 	struct s1d13xxxfb_par *default_par;
@@ -895,7 +902,7 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
 	return 0;
 
 bail:
-	s1d13xxxfb_remove(pdev);
+	__s1d13xxxfb_remove(pdev);
 	return ret;
 
 }
Signature · 1 line
2.25.2
#1 lore raw
Quoted 6 lines · Chuhong Yuan

The driver calls register_framebuffer() in probe but does not call unregister_framebuffer() in remove.
Rename current remove to __s1d13xxxfb_remove() for error handler. Then add a new remove to call unregister_framebuffer().

Patch queued for v5.8 (w/ extra newline removed), thanks.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

Quoted 53 lines

---
Changes in v3:
- Fix code style.
- Set __s1d13xxxfb_remove() to return void.
- Remove redundant check for info.

 drivers/video/fbdev/s1d13xxxfb.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/video/fbdev/s1d13xxxfb.c +11 -4
index 8048499e398d..d51ef7619115 100644
@@ -721,9 +721,7 @@ static void s1d13xxxfb_fetch_hw_state(struct fb_info *info)
 		xres, yres, xres_virtual, yres_virtual, is_color, is_dual, is_tft);
 }
 
-
-static int
-s1d13xxxfb_remove(struct platform_device *pdev)
+static void __s1d13xxxfb_remove(struct platform_device *pdev)
 {
 	struct fb_info *info = platform_get_drvdata(pdev);
 	struct s1d13xxxfb_par *par = NULL;
@@ -749,9 +747,18 @@ s1d13xxxfb_remove(struct platform_device *pdev)
 			pdev->resource[0].end - pdev->resource[0].start +1);
 	release_mem_region(pdev->resource[1].start,
 			pdev->resource[1].end - pdev->resource[1].start +1);
+}
+
+static int s1d13xxxfb_remove(struct platform_device *pdev)
+{
+	struct fb_info *info = platform_get_drvdata(pdev);
+
+	unregister_framebuffer(info);
+	__s1d13xxxfb_remove(pdev);
 	return 0;
 }
 
+
 static int s1d13xxxfb_probe(struct platform_device *pdev)
 {
 	struct s1d13xxxfb_par *default_par;
@@ -895,7 +902,7 @@ static int s1d13xxxfb_probe(struct platform_device *pdev)
 	return 0;
 
 bail:
-	s1d13xxxfb_remove(pdev);
+	__s1d13xxxfb_remove(pdev);
 	return ret;
 
 }