Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andrzej Hajda and committed by
Lee Jones
b3de3402 a5d8e2e7

+2
+2
drivers/video/backlight/backlight.c
··· 223 223 mutex_lock(&bd->ops_lock); 224 224 if (bd->ops && bd->ops->get_brightness) 225 225 rc = sprintf(buf, "%d\n", bd->ops->get_brightness(bd)); 226 + else 227 + rc = sprintf(buf, "%d\n", bd->props.brightness); 226 228 mutex_unlock(&bd->ops_lock); 227 229 228 230 return rc;