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

backlight: ipaq_micro: 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-4-steve@sk2.org

authored by

Stephen Kitt and committed by
Lee Jones
e3b2ac40 fef0b89a

+1 -6
+1 -6
drivers/video/backlight/ipaq_micro_bl.c
··· 16 16 static int micro_bl_update_status(struct backlight_device *bd) 17 17 { 18 18 struct ipaq_micro *micro = dev_get_drvdata(&bd->dev); 19 - int intensity = bd->props.brightness; 19 + int intensity = backlight_get_brightness(bd); 20 20 struct ipaq_micro_msg msg = { 21 21 .id = MSG_BACKLIGHT, 22 22 .tx_len = 3, 23 23 }; 24 - 25 - if (bd->props.power != FB_BLANK_UNBLANK) 26 - intensity = 0; 27 - if (bd->props.state & (BL_CORE_FBBLANK | BL_CORE_SUSPENDED)) 28 - intensity = 0; 29 24 30 25 /* 31 26 * Message format: