[PATCH 12/15] auxdisplay: ht16k33: Introduce backlight_get_brightness()

Sam Ravnborg via B4 Submission Endpoint devnull+sam.ravnborg.org at kernel.org
Sat Jan 7 18:26:26 UTC 2023


From: Sam Ravnborg <sam at ravnborg.org>

Introduce backlight_get_brightness() to simplify logic
and avoid direct access to backlight properties.

Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
Cc: Robin van der Gracht <robin at protonic.nl>
Cc: Miguel Ojeda <ojeda at kernel.org>
Cc: Geert Uytterhoeven <geert at linux-m68k.org>
---
 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);
 }
 

-- 
2.34.1


More information about the dri-devel mailing list