Re: [PATCH 02/15] video: fbdev: atyfb: Introduce backlight_get_brightness()

From
Christophe Leroy <hidden>
Date
2023-01-09 17:44:55
Also in
dri-devel, linux-arm-kernel, linux-fbdev, linux-omap, linux-staging, lkml
Reply to
Sam Ravnborg via B4 Submission Endpoint, 2023-01-07

Le 07/01/2023 à 19:26, Sam Ravnborg via B4 Submission Endpoint a écrit :
From: Sam Ravnborg <redacted>

Introduce backlight_get_brightness() to simplify logic
and avoid direct access to backlight properties.
When I read 'introduce' I understand that you are adding a new function.

In fact backlight_get_brightness() already exists, so maybe replace 
'introduce' by 'use'

quoted hunk ↗ jump to hunk
Signed-off-by: Sam Ravnborg <redacted>
Cc: Bartlomiej Zolnierkiewicz <redacted>
Cc: Sam Ravnborg <redacted>
Cc: Daniel Vetter <redacted>
Cc: Souptick Joarder <redacted>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Jason Yan <yanaijie@huawei.com>
Cc: Jani Nikula <redacted>
Cc: Arnd Bergmann <arnd@arndb.de>
---
  drivers/video/fbdev/aty/atyfb_base.c | 8 +-------
  1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/drivers/video/fbdev/aty/atyfb_base.c b/drivers/video/fbdev/aty/atyfb_base.c
index 0ccf5d401ecb..ca361e215904 100644
--- a/drivers/video/fbdev/aty/atyfb_base.c
+++ b/drivers/video/fbdev/aty/atyfb_base.c
@@ -2219,13 +2219,7 @@ static int aty_bl_update_status(struct backlight_device *bd)
  {
         struct atyfb_par *par = bl_get_data(bd);
         unsigned int reg = aty_ld_lcd(LCD_MISC_CNTL, par);
-       int level;
-
-       if (bd->props.power != FB_BLANK_UNBLANK ||
-           bd->props.fb_blank != FB_BLANK_UNBLANK)
-               level = 0;
-       else
-               level = bd->props.brightness;
+       int level = backlight_get_brightness(bd);

         reg |= (BLMOD_EN | BIASMOD_EN);
         if (level > 0) {

--
2.34.1
Thread (52 messages) 52 messages, 11 authors, last reply 2023-03-19
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help