summaryrefslogtreecommitdiffstats
path: root/drivers/platform/x86/compal-laptop.c
diff options
context:
space:
mode:
authorStephen Kitt <steve@sk2.org>2022-06-07 20:46:34 +0200
committerHans de Goede <hdegoede@redhat.com>2022-06-22 11:53:56 +0200
commit537c7933c8e4dbc0064bf3e84d3a36d92ea66952 (patch)
tree01257cdf883888cf9c3c5dee5022b8da4eab89ef /drivers/platform/x86/compal-laptop.c
parentplatform/x86: apple-gmux: Use backlight helper (diff)
downloadlinux-537c7933c8e4dbc0064bf3e84d3a36d92ea66952.tar.xz
linux-537c7933c8e4dbc0064bf3e84d3a36d92ea66952.zip
platform/x86: compal-laptop: Use backlight helper
Instead of manually checking the power state in struct backlight_properties, use backlight_is_blank(). Signed-off-by: Stephen Kitt <steve@sk2.org> Cc: Cezary Jackiewicz <cezary.jackiewicz@gmail.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Mark Gross <markgross@kernel.org> Cc: platform-driver-x86@vger.kernel.org Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Link: https://lore.kernel.org/r/20220607184635.1127913-4-steve@sk2.org Reviewed-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform/x86/compal-laptop.c')
-rw-r--r--drivers/platform/x86/compal-laptop.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index ab610376fdad..0942f50bd793 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -324,9 +324,7 @@ static int bl_update_status(struct backlight_device *b)
if (ret)
return ret;
- set_backlight_state((b->props.power == FB_BLANK_UNBLANK)
- && !(b->props.state & BL_CORE_SUSPENDED)
- && !(b->props.state & BL_CORE_FBBLANK));
+ set_backlight_state(!backlight_is_blank(b));
return 0;
}