Skip to content

Commit

Permalink
regulator: max8997: Remove is_enabled callback implementation for max…
Browse files Browse the repository at this point in the history
…8997_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>
  • Loading branch information
Axel Lin authored and Mark Brown committed Apr 23, 2012
1 parent 94e85a3 commit c245c08
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/regulator/max8997.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,9 +278,7 @@ static int max8997_reg_is_enabled(struct regulator_dev *rdev)
u8 val;

ret = max8997_get_enable_register(rdev, &reg, &mask, &pattern);
if (ret == -EINVAL)
return 1; /* "not controllable" */
else if (ret)
if (ret)
return ret;

ret = max8997_read_reg(i2c, reg, &val);
Expand Down Expand Up @@ -887,7 +885,6 @@ static struct regulator_ops max8997_charger_ops = {
};

static struct regulator_ops max8997_charger_fixedstate_ops = {
.is_enabled = max8997_reg_is_enabled,
.get_current_limit = max8997_get_current_limit,
.set_current_limit = max8997_set_current_limit,
};
Expand Down

0 comments on commit c245c08

Please sign in to comment.