Skip to contentSkip to conversation

fbdev/da8xx-fb: unlock on error paths in suspend/resume

PATCH In review Dan Carpenter 2 participants 3 messages Oct 11, 2024 – Oct 14, 2024

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

PATCH 1/1 fbdev/da8xx-fb: unlock on error paths in suspend/resume

Add a missing console_unlock() in the suspend and resume functions on the error paths.

Fixes 611097d5daea ("fbdev: da8xx: add support for a regulator")
---
 drivers/video/fbdev/da8xx-fb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/video/fbdev/da8xx-fb.c +6 -2
index fad1e13c6332..66ff8456b231 100644
@@ -1610,8 +1610,10 @@ static int fb_suspend(struct device *dev)
 	console_lock();
 	if (par->lcd_supply) {
 		ret = regulator_disable(par->lcd_supply);
-		if (ret)
+		if (ret) {
+			console_unlock();
 			return ret;
+		}
 	}
 
 	fb_set_suspend(info, 1);
@@ -1636,8 +1638,10 @@ static int fb_resume(struct device *dev)
 
 		if (par->lcd_supply) {
 			ret = regulator_enable(par->lcd_supply);
-			if (ret)
+			if (ret) {
+				console_unlock();
 				return ret;
+			}
 		}
 	}
 
Signature · 1 line
2.45.2
Reviewed-by on v1 1/1
#1 lore raw
Quoted 39 lines · Dan Carpenter

Add a missing console_unlock() in the suspend and resume functions on the error paths.

Fixes 611097d5daea ("fbdev: da8xx: add support for a regulator")
---
 drivers/video/fbdev/da8xx-fb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/video/fbdev/da8xx-fb.c +6 -3
index fad1e13c6332..66ff8456b231 100644
@@ -1610,8 +1610,10 @@ static int fb_suspend(struct device *dev)
        console_lock();
        if (par->lcd_supply) {
                ret = regulator_disable(par->lcd_supply);
-               if (ret)
+               if (ret) {
+                       console_unlock();
                        return ret;
+               }
        }
 
        fb_set_suspend(info, 1);
@@ -1636,8 +1638,10 @@ static int fb_resume(struct device *dev)
 
                if (par->lcd_supply) {
                        ret = regulator_enable(par->lcd_supply);
-                       if (ret)
+                       if (ret) {
+                               console_unlock();
                                return ret;
+                       }
                }
        }
 
--
Quoted 2 lines

2.45.2

#2 lore raw
Quoted 40 lines · Bartosz Golaszewski
Quoted 38 lines · Dan Carpenter

Add a missing console_unlock() in the suspend and resume functions on the error paths.

Fixes 611097d5daea ("fbdev: da8xx: add support for a regulator")
---
 drivers/video/fbdev/da8xx-fb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/video/fbdev/da8xx-fb.c +6 -2
index fad1e13c6332..66ff8456b231 100644
@@ -1610,8 +1610,10 @@ static int fb_suspend(struct device *dev)
        console_lock();
        if (par->lcd_supply) {
                ret = regulator_disable(par->lcd_supply);
-               if (ret)
+               if (ret) {
+                       console_unlock();
                        return ret;
+               }
        }
 
        fb_set_suspend(info, 1);
@@ -1636,8 +1638,10 @@ static int fb_resume(struct device *dev)
 
                if (par->lcd_supply) {
                        ret = regulator_enable(par->lcd_supply);
-                       if (ret)
+                       if (ret) {
+                               console_unlock();
                                return ret;
+                       }
                }
        }
 
Quoted 5 lines
Quoted 3 lines

--
2.45.2

I technically still maintain this platform so I took a second look and seeing this[1] made me realize that this driver is no longer used on any board. The platform data structure is not defined anywhere and there's no OF compatible list.

This patch can be dropped and I'll send one removing this driver from the kernel.

Bartosz

[1] https://elixir.bootlin.com/linux/v6.11.3/source/drivers/video/fbdev/da8xx-fb.c#L1340