Skip to content

Commit e3b2ac4

Browse files
skittlag-linaro
authored andcommitted
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 <[email protected]> Reviewed-by: Sam Ravnborg <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Signed-off-by: Lee Jones <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent fef0b89 commit e3b2ac4

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

drivers/video/backlight/ipaq_micro_bl.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,12 @@
1616
static int micro_bl_update_status(struct backlight_device *bd)
1717
{
1818
struct ipaq_micro *micro = dev_get_drvdata(&bd->dev);
19-
int intensity = bd->props.brightness;
19+
int intensity = backlight_get_brightness(bd);
2020
struct ipaq_micro_msg msg = {
2121
.id = MSG_BACKLIGHT,
2222
.tx_len = 3,
2323
};
2424

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-
3025
/*
3126
* Message format:
3227
* Byte 0: backlight instance (usually 1)

0 commit comments

Comments
 (0)