Skip to contentSkip to conversation

fbdev: s1d13xxxfb: add missed unregister_framebuffer in remove

PATCH Superseded Chuhong Yuan 2 participants 2 messages Nov 18, 2019 – Jan 15, 2020

Subsystems (2)

v1 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH 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.
Add the missed call to fix it.

---
 drivers/video/fbdev/s1d13xxxfb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/fbdev/s1d13xxxfb.c +1 -0
index e04efb567b5c..162003ea6b79 100644
@@ -729,6 +729,7 @@ s1d13xxxfb_remove(struct platform_device *pdev)
 	struct s1d13xxxfb_par *par = NULL;
 
 	if (info) {
+		unregister_framebuffer(info);
 		par = info->par;
 		if (par && par->regs) {
 			/* disable output & enable powersave */
Signature · 1 line
2.24.0
#1 lore raw
Quoted 14 lines · Chuhong Yuan

The driver calls register_framebuffer in probe but does not call unregister_framebuffer in remove.
Add the missed call to fix it.

---
 drivers/video/fbdev/s1d13xxxfb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/video/fbdev/s1d13xxxfb.c +0 -0
index e04efb567b5c..162003ea6b79 100644

drivers/video/fbdev/s1d13xxxfb.c s1d13xxxfb_remove(struct platform_device *pdev) · line 732

Quoted 4 lines
drivers/video/fbdev/s1d13xxxfb.c +1 -0
@@ -729,6 +729,7 @@ s1d13xxxfb_remove(struct platform_device *pdev)
 	struct s1d13xxxfb_par *par = NULL;
 
 	if (info) {
+		unregister_framebuffer(info);

s1d13xxxfb_remove() is not only called on removal operation but also by s1d13xxxfb_probe() on register_framebuffer() failure. After above change the code in s1d13xxxfb_probe() will break. The issue needs to be fixed in different way, i.e.

- rename existing s1d13xxxfb_remove() to __s1d13xxxfb_remove()

- add s1d13xxxfb_remove() which does unregister_framebuffer() and then calls __s1d13xxxfb_remove())

drivers/video/fbdev/s1d13xxxfb.c s1d13xxxfb_remove(struct platform_device *pdev) · line 735

Quoted 4 lines
drivers/video/fbdev/s1d13xxxfb.c +0 -0
 		par = info->par;
 		if (par && par->regs) {
 			/* disable output & enable powersave */

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