diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-04-07 23:12:28 +0800 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-04-08 11:23:31 +0100 |
commit | 438e695b87e03953fc4ba1aff59feab33c9c79a7 (patch) | |
tree | 64320ec2f972748d641ab32c47c6ed5d4b8b2ed1 /drivers/regulator/ab8500-ext.c | |
parent | cd2a55d2eb8b58672d2805388aa4a8e354381c96 (diff) |
regulator: ab8500: Get rid of is_enabled from struct ab8500_regulator_info
The intention of this patch is to simplify the code.
Maintain the is_enabled flag is not trivial, it not only needs to set/clear the
flag in disable()/enable() but also needs to set the flag in is_enable() to get
initial status. The only benefit of keeping is_enabled flag is just save a
register read when set_mode(). Remove is_enabled flag makes the code simpler.
This patch also moves ab8500_regulator_is_enabled() close to
ab8500_regulator_[en|dis]able functions.
This is required to avoid a forward declaration because now we call
ab8500_regulator_is_enabled() in ab8500_regulator_set_mode().
This change also makes the code better in readability by moving similar
functions to one place.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/ab8500-ext.c')
0 files changed, 0 insertions, 0 deletions