All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: Use regulator framework correctly
@ 2010-08-05  8:10 Adrian Hunter
  0 siblings, 0 replies; only message in thread
From: Adrian Hunter @ 2010-08-05  8:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-mmc@vger.kernel.org

>From 3f382fcf80afc4f28f471138ceb7b69b4055c9c3 Mon Sep 17 00:00:00 2001
From: Adrian Hunter <adrian.hunter@nokia.com>
Date: Thu, 5 Aug 2010 10:45:24 +0300
Subject: [PATCH] mmc: Use regulator framework correctly

Issues with the regulator framework no longer exist, so
regulator_enable() / regulator_disable() should be used
correctly.

Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
---
 drivers/mmc/core/core.c |    9 ++-------
 1 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c
index 2cfefa6..da73899 100644
--- a/drivers/mmc/core/core.c
+++ b/drivers/mmc/core/core.c
@@ -784,11 +784,6 @@ int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit)
 {
 	int			result = 0;
 	int			min_uV, max_uV;
-	int			enabled;
-
-	enabled = regulator_is_enabled(supply);
-	if (enabled < 0)
-		return enabled;
 
 	if (vdd_bit) {
 		int		tmp;
@@ -819,9 +814,9 @@ int mmc_regulator_set_ocr(struct regulator *supply, unsigned short vdd_bit)
 		else
 			result = 0;
 
-		if (result == 0 && !enabled)
+		if (result == 0)
 			result = regulator_enable(supply);
-	} else if (enabled) {
+	} else {
 		result = regulator_disable(supply);
 	}
 
-- 
1.6.3.3

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2010-08-05  8:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-05  8:10 [PATCH] mmc: Use regulator framework correctly Adrian Hunter

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.