summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrzej Hajda <a.hajda@samsung.com>2014-05-30 12:10:49 +0200
committerLee Jones <lee.jones@linaro.org>2014-06-23 13:26:02 +0100
commitb3de3402e5ab8edfbbdbbb86393692431522f6d3 (patch)
tree4cd96d0703f3e15f896753560ea679c376c06644
parenta5d8e2e73c7f1dcee485d55225628317d8d441c0 (diff)
downloadop-kernel-dev-b3de3402e5ab8edfbbdbbb86393692431522f6d3.zip
op-kernel-dev-b3de3402e5ab8edfbbdbbb86393692431522f6d3.tar.gz
backlight: Show brightness even if get_brightness is not implemented
Many implementations of get_brightness operation returns only value of props.brightness field. This change makes such implementations unnecessary. Acked-by: Jingoo Han <jg1.han@samsung.com> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Lee Jones <lee.jones@linaro.org>
-rw-r--r--drivers/video/backlight/backlight.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 4280890..bddc8b1 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -223,6 +223,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;
OpenPOWER on IntegriCloud