All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/2] video: imxfb: Fix unbalanced regulators
@ 2014-06-23 13:07 Denis Carikli
  2014-06-23 13:07 ` [PATCH v2 2/2] video: imxfb: Fix lcd_ops .set_power and .get_power on/off inversion Denis Carikli
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Denis Carikli @ 2014-06-23 13:07 UTC (permalink / raw)
  To: linux-arm-kernel

Both regulator_enable and regulator_disable's comments
say that they must be balanced with its counterpart
enable/disable function.

Not doing it result in kernel warnings each time
the lcd is powered off twice, for instance trough sysfs.

Signed-off-by: Denis Carikli <denis@eukrea.com>
---
Changelog v1->v2:
 - None
---
 drivers/video/fbdev/imxfb.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/video/fbdev/imxfb.c b/drivers/video/fbdev/imxfb.c
index f6e6216..121cbd7 100644
--- a/drivers/video/fbdev/imxfb.c
+++ b/drivers/video/fbdev/imxfb.c
@@ -769,9 +769,9 @@ static int imxfb_lcd_set_power(struct lcd_device *lcddev, int power)
 	struct imxfb_info *fbi = dev_get_drvdata(&lcddev->dev);
 
 	if (!IS_ERR(fbi->lcd_pwr)) {
-		if (power)
+		if (power && !regulator_is_enabled(fbi->lcd_pwr))
 			return regulator_enable(fbi->lcd_pwr);
-		else
+		else if (regulator_is_enabled(fbi->lcd_pwr))
 			return regulator_disable(fbi->lcd_pwr);
 	}
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-06-25 12:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-23 13:07 [PATCH v2 1/2] video: imxfb: Fix unbalanced regulators Denis Carikli
2014-06-23 13:07 ` [PATCH v2 2/2] video: imxfb: Fix lcd_ops .set_power and .get_power on/off inversion Denis Carikli
2014-06-25  6:16   ` Sascha Hauer
2014-06-25 12:57     ` Denis Carikli
2014-06-25  6:08 ` [PATCH v2 1/2] video: imxfb: Fix unbalanced regulators Sascha Hauer
2014-06-25  8:51   ` Denis Carikli
2014-06-25  8:58     ` Denis Carikli
2014-06-25  9:33     ` Sascha Hauer
2014-06-25  6:17 ` Shawn Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.