aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/regulator/max8997.c
diff options
context:
space:
mode:
authorAxel Lin <axel.lin@gmail.com>2012-04-17 11:48:27 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2012-04-23 08:20:24 -0400
commitc245c087c50eabe284b22f7d5a8abc12427d29a7 (patch)
tree1572f5b272cec44a50268cdd35d140206d52bdf7 /drivers/regulator/max8997.c
parent94e85a3c5d702a4ce96b7a9b883c949a08ebd93c (diff)
regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fixedstate_ops
If is_enabled callback is not implemented, the core assumes that the regulator is on. This is simpler than having a hack to retrun 1 in max8997_reg_is_enabled() if max8997_get_enable_register() returns -EINVAL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'drivers/regulator/max8997.c')
-rw-r--r--drivers/regulator/max8997.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
index ec99bd30e603..d106b74fc821 100644
--- a/drivers/regulator/max8997.c
+++ b/drivers/regulator/max8997.c
@@ -278,9 +278,7 @@ static int max8997_reg_is_enabled(struct regulator_dev *rdev)
278 u8 val; 278 u8 val;
279 279
280 ret = max8997_get_enable_register(rdev, &reg, &mask, &pattern); 280 ret = max8997_get_enable_register(rdev, &reg, &mask, &pattern);
281 if (ret == -EINVAL) 281 if (ret)
282 return 1; /* "not controllable" */
283 else if (ret)
284 return ret; 282 return ret;
285 283
286 ret = max8997_read_reg(i2c, reg, &val); 284 ret = max8997_read_reg(i2c, reg, &val);
@@ -887,7 +885,6 @@ static struct regulator_ops max8997_charger_ops = {
887}; 885};
888 886
889static struct regulator_ops max8997_charger_fixedstate_ops = { 887static struct regulator_ops max8997_charger_fixedstate_ops = {
890 .is_enabled = max8997_reg_is_enabled,
891 .get_current_limit = max8997_get_current_limit, 888 .get_current_limit = max8997_get_current_limit,
892 .set_current_limit = max8997_set_current_limit, 889 .set_current_limit = max8997_set_current_limit,
893}; 890};