aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator
diff options
context:
space:
mode:
authorYadwinder Singh Brar <yadi.brar@samsung.com>2013-06-29 18:21:19 +0530
committerMark Brown <broonie@linaro.org>2013-07-15 11:27:48 +0100
commit5b175952011adae30b531ab89cc24acb173b2ce4 (patch)
tree3d32b5482cb43df0958ca9e93381249c889fe9ee /drivers/regulator
parent1653ccf4c52df6a4abe8ec2f33f2cb2896d129ea (diff)
downloadkernel_goldelico_gta04-5b175952011adae30b531ab89cc24acb173b2ce4.zip
kernel_goldelico_gta04-5b175952011adae30b531ab89cc24acb173b2ce4.tar.gz
kernel_goldelico_gta04-5b175952011adae30b531ab89cc24acb173b2ce4.tar.bz2
regulator: core: Remove redundant checks
In function _regulator_do_set_voltage(), old_selector gets intialised only if (_regulator_is_enabled(rdev) && rdev->desc->ops->set_voltage_time_sel && rdev->desc->ops->get_voltage_sel)) is true. Before calling set_voltage_time_sel() we checks if (old_selector >= 0) and it will true if it got intialised properly. so we don't need to check again _regulator_is_enabled(rdev) && rdev->desc->ops->set_voltage_time_sel before calling set_voltage_time_sel(). Signed-off-by: Yadwinder Singh Brar <yadi.brar@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 6e6371c..15368f3 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -2439,9 +2439,8 @@ static int _regulator_do_set_voltage(struct regulator_dev *rdev,
}
/* Call set_voltage_time_sel if successfully obtained old_selector */
- if (ret == 0 && !rdev->constraints->ramp_disable &&
- _regulator_is_enabled(rdev) && old_selector >= 0 &&
- old_selector != selector && rdev->desc->ops->set_voltage_time_sel) {
+ if (ret == 0 && !rdev->constraints->ramp_disable && old_selector >= 0
+ && old_selector != selector) {
delay = rdev->desc->ops->set_voltage_time_sel(rdev,
old_selector, selector);