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

backlight: arcxcnn: Use backlight helper

Instead of retrieving the backlight brightness in struct
backlight_properties manually, and then checking whether the backlight
should be on at all, use backlight_get_brightness() which does all
this and insulates this from future changes.

Signed-off-by: Stephen Kitt <steve@sk2.org>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Lee Jones <lee@kernel.org>
Link: https://lore.kernel.org/r/20230106164856.1453819-3-steve@sk2.org

authored by

Stephen Kitt and committed by
Lee Jones
fef0b89a 3a396f98

+1 -4
+1 -4
drivers/video/backlight/arcxcnn_bl.c
··· 130 130 static int arcxcnn_bl_update_status(struct backlight_device *bl) 131 131 { 132 132 struct arcxcnn *lp = bl_get_data(bl); 133 - u32 brightness = bl->props.brightness; 133 + u32 brightness = backlight_get_brightness(bl); 134 134 int ret; 135 - 136 - if (bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK)) 137 - brightness = 0; 138 135 139 136 ret = arcxcnn_set_brightness(lp, brightness); 140 137 if (ret)