Skip to content

Commit

Permalink
backlight: ipaq_micro: Use backlight helper
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Stephen Kitt authored and Lee Jones committed Feb 22, 2023
1 parent fef0b89 commit e3b2ac4
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/video/backlight/ipaq_micro_bl.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,12 @@
static int micro_bl_update_status(struct backlight_device *bd)
{
struct ipaq_micro *micro = dev_get_drvdata(&bd->dev);
int intensity = bd->props.brightness;
int intensity = backlight_get_brightness(bd);
struct ipaq_micro_msg msg = {
.id = MSG_BACKLIGHT,
.tx_len = 3,
};

if (bd->props.power != FB_BLANK_UNBLANK)
intensity = 0;
if (bd->props.state & (BL_CORE_FBBLANK | BL_CORE_SUSPENDED))
intensity = 0;

/*
* Message format:
* Byte 0: backlight instance (usually 1)
Expand Down

0 comments on commit e3b2ac4

Please sign in to comment.