]> git.baikalelectronics.ru Git - kernel.git/commit
regulator: core: Remove redundant checks
authorYadwinder Singh Brar <yadi.brar@samsung.com>
Sat, 29 Jun 2013 12:51:19 +0000 (18:21 +0530)
committerMark Brown <broonie@linaro.org>
Mon, 15 Jul 2013 10:27:48 +0000 (11:27 +0100)
commitb79f4fed688755c890c3efbcf361f2bd0f226af6
tree3d32b5482cb43df0958ca9e93381249c889fe9ee
parent5f5fd02d46900c05f28dfab2c68e757f65120a8b
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>
drivers/regulator/core.c