Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 26bbabc8 authored by Alberto Panizzo's avatar Alberto Panizzo Committed by Linus Torvalds
Browse files

drivers/video/backlight/l4f00242t03.c: prevent unbalanced calls to regulator enable/disable



Otherwise a double call to:
$ echo 4 > /sys/class/lcd/l4f00242t03/lcd_power
Will, the first power down the lcd and regulators correctly and the
second produce an unbalanced call to regulator disable.

Signed-off-by: default avatarAlberto Panizzo <maramaopercheseimorto@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Marek Vasut <marek.vasut@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Cc: Axel Lin <axel.lin@gmail.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 95558ad1
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -134,11 +134,13 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
		}
	} else {
		/* power == FB_BLANK_POWERDOWN */
		if (priv->lcd_state != FB_BLANK_POWERDOWN) {
			/* Clear the screen before shutting down */
			spi_write(spi, (const u8 *)&disoff, sizeof(u16));
			msleep(60);
			l4f00242t03_lcd_powerdown(spi);
		}
	}

	priv->lcd_state = power;