power: supply: bq24735-charger: simplify register update to stop charging
authorPeter Rosin <peda@axentia.se>
Tue, 13 Dec 2016 23:56:43 +0000 (00:56 +0100)
committerSebastian Reichel <sre@kernel.org>
Wed, 4 Jan 2017 20:58:42 +0000 (21:58 +0100)
Providing value bits outside of the mask is pointless.

Signed-off-by: Peter Rosin <peda@axentia.se>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
drivers/power/supply/bq24735-charger.c

index eb7783b42e0acdd2cf8eb4e1b75bbfdbc3df9605..1d5c9206e0edc6a924808de85e9043f701bcfeab 100644 (file)
@@ -111,8 +111,7 @@ static inline int bq24735_enable_charging(struct bq24735 *charger)
                return 0;
 
        return bq24735_update_word(charger->client, BQ24735_CHG_OPT,
-                                  BQ24735_CHG_OPT_CHARGE_DISABLE,
-                                  ~BQ24735_CHG_OPT_CHARGE_DISABLE);
+                                  BQ24735_CHG_OPT_CHARGE_DISABLE, 0);
 }
 
 static inline int bq24735_disable_charging(struct bq24735 *charger)