Skip to content

Commit

Permalink
platform/x86: thinkpad_acpi: 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 <[email protected]>
Cc: Henrique de Moraes Holschuh <[email protected]>
Cc: Hans de Goede <[email protected]>
Cc: Mark Gross <[email protected]>
Cc: [email protected]
Cc: [email protected]
Reviewed-by: Daniel Thompson <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Reviewed-by: Hans de Goede <[email protected]>
Signed-off-by: Hans de Goede <[email protected]>
  • Loading branch information
skitt authored and jwrdegoede committed Jun 22, 2022
1 parent 537c793 commit 5b54b4d
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/platform/x86/thinkpad_acpi.c
Original file line number Diff line number Diff line change
Expand Up @@ -6798,10 +6798,7 @@ static int brightness_set(unsigned int value)

static int brightness_update_status(struct backlight_device *bd)
{
unsigned int level =
(bd->props.fb_blank == FB_BLANK_UNBLANK &&
bd->props.power == FB_BLANK_UNBLANK) ?
bd->props.brightness : 0;
int level = backlight_get_brightness(bd);

dbg_printk(TPACPI_DBG_BRGHT,
"backlight: attempt to set level to %d\n",
Expand Down

0 comments on commit 5b54b4d

Please sign in to comment.