@@ -107,13 +107,7 @@ static int as3711_bl_update_status(struct backlight_device *bl)
int brightness = bl->props.brightness;
int ret = 0;
- dev_dbg(&bl->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) {
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 <sam@ravnborg.org> Cc: Lee Jones <lee.jones@linaro.org> Cc: Daniel Thompson <daniel.thompson@linaro.org> Cc: Jingoo Han <jingoohan1@gmail.com> Cc: Emil Velikov <emil.l.velikov@gmail.com> --- drivers/video/backlight/as3711_bl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)