[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220607180406.1116277-1-steve@sk2.org>
Date: Tue, 7 Jun 2022 20:04:06 +0200
From: Stephen Kitt <steve@....org>
To: Robin van der Gracht <robin@...tonic.nl>,
Miguel Ojeda <ojeda@...nel.org>
Cc: linux-kernel@...r.kernel.org, Stephen Kitt <steve@....org>
Subject: [PATCH] auxdisplay: ht16k33: Use backlight helper
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.
Signed-off-by: Stephen Kitt <steve@....org>
Cc: Robin van der Gracht <robin@...tonic.nl>
Cc: Miguel Ojeda <ojeda@...nel.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 4fab3b2c7023..dbadff38999a 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);
}
base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
--
2.30.2
Powered by blists - more mailing lists