[PATCH 1/2] backlight: show brightness even if get_brightness is not implemented

From
Andrzej Hajda <hidden>
Date
2014-05-30 10:10:49
Also in
linux-arm-kernel, linux-pwm, linux-samsung-soc, platform-driver-x86
Reply to
Andrzej Hajda, 2014-05-30
Many implementations of get_brightness operation returns only value
of props.brightness field. This change makes such implementations
unnecessary.

Signed-off-by: Andrzej Hajda <redacted>
---
 drivers/video/backlight/backlight.c | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 19b170d..0ce8823 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -221,6 +221,8 @@ static ssize_t actual_brightness_show(struct device *dev,
 	mutex_lock(&bd->ops_lock);
 	if (bd->ops && bd->ops->get_brightness)
 		rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd));
+	else
+		rc = sprintf(buf, "%d\n", bd->props.brightness);
 	mutex_unlock(&bd->ops_lock);
 
 	return rc;
-- 
1.9.1
Thread (5 messages) 5 messages, 3 authors, last reply 2014-06-16
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help