lkml.org 
[lkml]   [2023]   [Jan]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2] auxdisplay: ht16k33: Use backlight helper
On 2023-01-06 15:30, Stephen Kitt wrote:
> backlight_properties.fb_blank is deprecated. The states it represents
> are handled by other properties; but instead of accessing those
> properties directly, drivers should use the helpers provided by
> backlight.h.
>
> 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.
>
> This means that BL_CORE_SUSPENDED is now taken into account, as it
> should be.
>
> Signed-off-by: Stephen Kitt <steve@sk2.org>
> ---
>
> Notes:
> Changes since v1: mention BL_CORE_SUSPENDED.
>
> drivers/auxdisplay/ht16k33.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/auxdisplay/ht16k33.c
> b/drivers/auxdisplay/ht16k33.c
> index 02425991c159..15ab118c80f5 100644
> --- a/drivers/auxdisplay/ht16k33.c
> +++ b/drivers/auxdisplay/ht16k33.c
> @@ -314,14 +314,9 @@ static int ht16k33_initialize(struct ht16k33_priv
> *priv)
>
> static int ht16k33_bl_update_status(struct backlight_device *bl)
> {
> - int brightness = bl->props.brightness;
> + int brightness = backlight_get_brightness(bl);
> struct ht16k33_priv *priv = bl_get_data(bl);
>
> - if (bl->props.power != FB_BLANK_UNBLANK ||
> - bl->props.fb_blank != FB_BLANK_UNBLANK ||
> - bl->props.state & BL_CORE_FBBLANK)
> - brightness = 0;
> -
> return ht16k33_brightness_set(priv, brightness);
> }

Thank you Stephen (and Sam), looks good!

Reviewed-by: Robin van der Gracht <robin@protonic.nl>

\
 
 \ /
  Last update: 2023-03-26 23:32    [W:0.539 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site