Commit a2060f28 authored by Lars Poeschel's avatar Lars Poeschel Committed by Miguel Ojeda

auxdisplay: Call charlcd_backlight in place

This moves the call to charlcd_backlight from the end of the switch
into the actual case statement that originates the change of the
backlight. This is more consistent to what is now found in this switch.
Reviewed-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarLars Poeschel <poeschel@lemonage.de>
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 339acb08
......@@ -259,10 +259,16 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
break;
case '+': /* Back light ON */
priv->flags |= LCD_FLAG_L;
if (priv->flags != oldflags)
charlcd_backlight(lcd, CHARLCD_ON);
processed = 1;
break;
case '-': /* Back light OFF */
priv->flags &= ~LCD_FLAG_L;
if (priv->flags != oldflags)
charlcd_backlight(lcd, CHARLCD_OFF);
processed = 1;
break;
case '*': /* Flash back light */
......@@ -363,14 +369,6 @@ static inline int handle_lcd_special_code(struct charlcd *lcd)
break;
}
/* TODO: This indent party here got ugly, clean it! */
/* Check whether one flag was changed */
if (oldflags == priv->flags)
return processed;
if ((oldflags ^ priv->flags) & LCD_FLAG_L)
charlcd_backlight(lcd, !!(priv->flags & LCD_FLAG_L));
return processed;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment