diff options
author | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-10 18:45:19 +0100 |
---|---|---|
committer | Alex Gonzalez <alex.gonzalez@digi.com> | 2012-01-11 16:09:13 +0100 |
commit | a0b2c37568661949d7e822047ab6c3b95ccc5903 (patch) | |
tree | 572a9dcd77bffb186878ef7972b616b2962c2820 /drivers | |
parent | a826abfae97a855fe95174107efc512ab552bc46 (diff) |
da9052-regulator: Check for disabled regulator in get_voltage().
If a regulator is disabled, return zero voltage.
Signed-off-by: Alex Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/regulator/da9052-regulator.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/regulator/da9052-regulator.c b/drivers/regulator/da9052-regulator.c index bb5d3cdf10e8..9c51a28f6018 100644 --- a/drivers/regulator/da9052-regulator.c +++ b/drivers/regulator/da9052-regulator.c @@ -346,6 +346,9 @@ int da9052_ldo_buck_get_voltage(struct regulator_dev *rdev) int ldo_volt_uV = 0; int ret; + if( !da9052_ldo_buck_is_enabled(rdev) ) + return ldo_volt_uV; + ssc_msg.addr = da9052_regulators[id].reg_add; ssc_msg.data = 0; /* Read register */ |