From: Andrzej Hajda Date: Fri, 30 May 2014 10:10:49 +0000 (+0200) Subject: backlight: Show brightness even if get_brightness is not implemented X-Git-Tag: v3.17-rc1~84^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b3de3402e5ab8edfbbdbbb86393692431522f6d3;p=thirdparty%2Flinux.git 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 Signed-off-by: Andrzej Hajda Signed-off-by: Lee Jones --- diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index 428089009cd5e..bddc8b17a4d8a 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;