[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1340707652-29329-1-git-send-email-broonie@opensource.wolfsonmicro.com>
Date: Tue, 26 Jun 2012 11:47:32 +0100
From: Mark Brown <broonie@...nsource.wolfsonmicro.com>
To: Liam Girdwood <lrg@...com>
Cc: linux-kernel@...r.kernel.org, Axel Lin <axel.lin@...il.com>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>
Subject: [PATCH] regulator: core: Check for failed voltage sets before checking for delay
There is no need to consider waiting for the voltage to ramp if we
didn't manage to set it and looking at the return value is going to be
cheaper than is_enabled().
Signed-off-by: Mark Brown <broonie@...nsource.wolfsonmicro.com>
---
drivers/regulator/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 531441a..da31b8a 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2123,7 +2123,7 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
best_val = _regulator_get_voltage(rdev);
/* Call set_voltage_time_sel if successfully obtained old_selector */
- if (_regulator_is_enabled(rdev) && ret == 0 && old_selector >= 0 &&
+ if (ret == 0 && _regulator_is_enabled(rdev) && old_selector >= 0 &&
rdev->desc->ops->set_voltage_time_sel) {
delay = rdev->desc->ops->set_voltage_time_sel(rdev,
--
1.7.10
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists