mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 00:53:34 +02:00
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>
This commit is contained in:
parent
18697b4793
commit
72aef4f60f
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user