Re: [PATCH v3 12/13] backlight: as3711_bl: introduce backlight_is_blank()

2020-06-01 Thread Daniel Thompson
On Mon, Jun 01, 2020 at 08:52:06AM +0200, Sam Ravnborg wrote:
> Replaces the open-coded checks of the state, with the
> backlight_is_blank() helper. This increases readability
> of the code and aling the functionality across the drivers.
> 
> Futhermore drop the debug prints in update_status().
> If we need debug printing then we can add it to the backlight core.
> 
> Signed-off-by: Sam Ravnborg 

Reviewed-by: Daniel Thompson 


> Cc: Lee Jones 
> Cc: Daniel Thompson 
> Cc: Jingoo Han 
> Cc: Emil Velikov 
> ---
>  drivers/video/backlight/as3711_bl.c | 8 +---
>  1 file changed, 1 insertion(+), 7 deletions(-)
> 
> diff --git a/drivers/video/backlight/as3711_bl.c 
> b/drivers/video/backlight/as3711_bl.c
> index 33f0f0f2e8b3..cc5628beaffd 100644
> --- a/drivers/video/backlight/as3711_bl.c
> +++ b/drivers/video/backlight/as3711_bl.c
> @@ -107,13 +107,7 @@ static int as3711_bl_update_status(struct 
> backlight_device *bl)
>   int brightness = bl->props.brightness;
>   int ret = 0;
>  
> - dev_dbg(>dev, "%s(): brightness %u, pwr %x, blank %x, state %x\n",
> - __func__, bl->props.brightness, bl->props.power,
> - bl->props.fb_blank, bl->props.state);
> -
> - if (bl->props.power != FB_BLANK_UNBLANK ||
> - bl->props.fb_blank != FB_BLANK_UNBLANK ||
> - bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
> + if (backlight_is_blank(bl))
>   brightness = 0;
>  
>   if (data->type == AS3711_BL_SU1) {
> -- 
> 2.25.1
> 
___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel


[PATCH v3 12/13] backlight: as3711_bl: introduce backlight_is_blank()

2020-06-01 Thread Sam Ravnborg
Replaces the open-coded checks of the state, with the
backlight_is_blank() helper. This increases readability
of the code and aling the functionality across the drivers.

Futhermore drop the debug prints in update_status().
If we need debug printing then we can add it to the backlight core.

Signed-off-by: Sam Ravnborg 
Cc: Lee Jones 
Cc: Daniel Thompson 
Cc: Jingoo Han 
Cc: Emil Velikov 
---
 drivers/video/backlight/as3711_bl.c | 8 +---
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/video/backlight/as3711_bl.c 
b/drivers/video/backlight/as3711_bl.c
index 33f0f0f2e8b3..cc5628beaffd 100644
--- a/drivers/video/backlight/as3711_bl.c
+++ b/drivers/video/backlight/as3711_bl.c
@@ -107,13 +107,7 @@ static int as3711_bl_update_status(struct backlight_device 
*bl)
int brightness = bl->props.brightness;
int ret = 0;
 
-   dev_dbg(>dev, "%s(): brightness %u, pwr %x, blank %x, state %x\n",
-   __func__, bl->props.brightness, bl->props.power,
-   bl->props.fb_blank, bl->props.state);
-
-   if (bl->props.power != FB_BLANK_UNBLANK ||
-   bl->props.fb_blank != FB_BLANK_UNBLANK ||
-   bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
+   if (backlight_is_blank(bl))
brightness = 0;
 
if (data->type == AS3711_BL_SU1) {
-- 
2.25.1

___
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel