]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
regulator: max8997: Remove is_enabled callback implementation for max8997_charger_fix...
authorAxel Lin <axel.lin@gmail.com>
Tue, 17 Apr 2012 15:48:27 +0000 (23:48 +0800)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Mon, 23 Apr 2012 12:20:24 +0000 (13:20 +0100)
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>
drivers/regulator/max8997.c

index ec99bd30e603ff839bb8fbbf4675df07ccdf7d39..d106b74fc821a604e52f501fc1bb3af4e4d292af 100644 (file)
@@ -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);
@@ -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,
 };