Skip to content

Commit 5a09765

Browse files
sravnborgLee Jones
authored andcommitted
backlight: as3711_bl: Simplify update_status
Replaces the open-coded checks of the state, with the backlight_get_brightness() helper. This increases readability of the code and align the functionality across the drivers. Furthermore 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> Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
1 parent 2144d00 commit 5a09765

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

‎drivers/video/backlight/as3711_bl.c‎

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,17 +104,10 @@ static int as3711_bl_update_status(struct backlight_device *bl)
104104
struct as3711_bl_data *data = bl_get_data(bl);
105105
struct as3711_bl_supply *supply = to_supply(data);
106106
struct as3711 *as3711 = supply->as3711;
107-
int brightness = bl->props.brightness;
107+
int brightness;
108108
int ret = 0;
109109

110-
dev_dbg(&bl->dev, "%s(): brightness %u, pwr %x, blank %x, state %x\n",
111-
__func__, bl->props.brightness, bl->props.power,
112-
bl->props.fb_blank, bl->props.state);
113-
114-
if (bl->props.power != FB_BLANK_UNBLANK ||
115-
bl->props.fb_blank != FB_BLANK_UNBLANK ||
116-
bl->props.state & (BL_CORE_SUSPENDED | BL_CORE_FBBLANK))
117-
brightness = 0;
110+
brightness = backlight_get_brightness(bl);
118111

119112
if (data->type == AS3711_BL_SU1) {
120113
ret = as3711_set_brightness_v(as3711, brightness,

0 commit comments

Comments
 (0)