summaryrefslogtreecommitdiffstats
path: root/drivers/staging/olpc_dcon
diff options
context:
space:
mode:
authorStephen Kitt <steve@sk2.org>2022-06-07 21:00:49 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2022-06-10 09:00:43 +0200
commit72aef4f60ff90984fe7aa8b09698120a73373d7f (patch)
treeb86d7dbac64bd0214d63986fbca846b9e61e7bcf /drivers/staging/olpc_dcon
parent18697b479330508491928a0d8593ba6c005591b7 (diff)
downloadlinux-72aef4f60ff90984fe7aa8b09698120a73373d7f.tar.bz2
staging: olpc_dcon: 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. Cc: Jens Frederich <jfrederich@gmail.com> Cc: Jon Nettleton <jon.nettleton@gmail.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: linux-staging@lists.linux.dev Signed-off-by: Stephen Kitt <steve@sk2.org> Link: https://lore.kernel.org/r/20220607190049.1132154-1-steve@sk2.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/olpc_dcon')
-rw-r--r--drivers/staging/olpc_dcon/olpc_dcon.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/staging/olpc_dcon/olpc_dcon.c b/drivers/staging/olpc_dcon/olpc_dcon.c
index 7284cb4ac395..b9d570e9ad3b 100644
--- a/drivers/staging/olpc_dcon/olpc_dcon.c
+++ b/drivers/staging/olpc_dcon/olpc_dcon.c
@@ -517,10 +517,7 @@ static struct device_attribute dcon_device_files[] = {
static int dcon_bl_update(struct backlight_device *dev)
{
struct dcon_priv *dcon = bl_get_data(dev);
- u8 level = dev->props.brightness & 0x0F;
-
- if (dev->props.power != FB_BLANK_UNBLANK)
- level = 0;
+ u8 level = backlight_get_brightness(dev) & 0x0F;
if (level != dcon->bl_val)
dcon_set_backlight(dcon, level);