]> git.karo-electronics.de Git - linux-beck.git/commitdiff
backlight: Show brightness even if get_brightness is not implemented
authorAndrzej Hajda <a.hajda@samsung.com>
Fri, 30 May 2014 10:10:49 +0000 (12:10 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 23 Jun 2014 12:26:02 +0000 (13:26 +0100)
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>
drivers/video/backlight/backlight.c

index 428089009cd5ea96d67b765d6a62cdd1c1bb25a6..bddc8b17a4d8a688f978aa82c58ff8c7514b21f0 100644 (file)
@@ -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;