battery/mm8013: Fix reversed WANT_CHG flag.
battery_flag()'s return code is 0 on success.
TEST=see allowing charge in command battery
BRANCH=kukui
@@ -212,12 +212,12 @@ void battery_get_params(struct batt_params *batt)
if (battery_full_charge_capacity(&batt_new.full_capacity))
batt_new.flags |= BATT_FLAG_BAD_FULL_CAPACITY;
- if (battery_flag(&flag) && (flag & MM8013_FLAG_CHG))
- batt_new.flags |= BATT_FLAG_WANT_CHARGE;
-
if (battery_status(&batt_new.status))
batt_new.flags |= BATT_FLAG_BAD_STATUS;
+ if (!battery_flag(&flag) && (flag & MM8013_FLAG_CHG))
+ batt_new.flags |= BATT_FLAG_WANT_CHARGE;
+
batt_out:
/* Update visible battery parameters */
memcpy(batt, &batt_new, sizeof(*batt));
