summaryrefslogtreecommitdiffstats
path: root/drivers/auxdisplay/charlcd.c
diff options
context:
space:
mode:
authorLars Poeschel <poeschel@lemonage.de>2020-11-03 10:58:21 +0100
committerMiguel Ojeda <ojeda@kernel.org>2020-11-04 11:04:04 +0100
commita2060f288e15a69b2191b7e9df2e3d470e27e433 (patch)
treee6bccf224ef44e6b0d6a19ab24bf5eccc5c6ad4c /drivers/auxdisplay/charlcd.c
parent339acb082987a6b0aa7c67a5a77b29f6c81962f6 (diff)
downloadlinux-a2060f288e15a69b2191b7e9df2e3d470e27e433.tar.bz2
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: Willy Tarreau <w@1wt.eu> Signed-off-by: Lars Poeschel <poeschel@lemonage.de> Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Diffstat (limited to 'drivers/auxdisplay/charlcd.c')
-rw-r--r--drivers/auxdisplay/charlcd.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/drivers/auxdisplay/charlcd.c b/drivers/auxdisplay/charlcd.c
index dca1b138a239..0f0568a4bd35 100644
--- a/drivers/auxdisplay/charlcd.c
+++ b/drivers/auxdisplay/charlcd.c
@@ -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;
}