[PATCH v2 1/6] auxdisplay: ht16k33: Replace use of fb_blank with backlight helper
Thomas Zimmermann
tzimmermann at suse.de
Tue Mar 19 09:37:20 UTC 2024
Replace the use of struct backlight_properties.fb_blank with a call
to backlight_get_brightness(). The helper implements similar logic
as the driver's function. It also accounts for BL_CORE_SUSPENDED for
drivers that set BL_CORE_SUSPENDRESUME. Ht16k33 doesn't use this, so
there's no change in behaviour here.
Signed-off-by: Thomas Zimmermann <tzimmermann at suse.de>
Cc: Robin van der Gracht <robin at protonic.nl>
Cc: Miguel Ojeda <ojeda at kernel.org>
Reviewed-by: Sam Ravnborg <sam at ravnborg.org>
Reviewed-by: Geert Uytterhoeven <geert at linux-m68k.org>
Reviewed-by: Miguel Ojeda <ojeda at kernel.org>
Reviewed-by: Robin van der Gracht <robin at protonic.nl>
Reviewed-by: Dan Carpenter <dan.carpenter at linaro.org>
---
v2:
- update commit-message style according to subsystem (Lee)
- declare local var as const (Miguel)
- clarify BL_CORE_SUSPENDED (Miguel)
- fix grammar in commit message (Dan)
---
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 a90430b7d07ba..9081a5797c552 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;
+ const 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);
}
--
2.44.0
More information about the dri-devel
mailing list