Skip to contentSkip to conversation

power: supply: sbs-battery: use correct flags field

PATCH Superseded Michael Nosthoff 2 participants 3 messages Aug 15, 2019 Power supply

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 power: supply: sbs-battery: use correct flags field

the type flag is stored in the chip->flags field not in the client->flags field. This currently leads to never using the ti specific function but always falling back to the general one.

---
 drivers/power/supply/sbs-battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/sbs-battery.c +1 -1
index 048d205d7074..2e86cc1e0e35 100644
@@ -620,7 +620,7 @@ static int sbs_get_property(struct power_supply *psy,
 	switch (psp) {
 	case POWER_SUPPLY_PROP_PRESENT:
 	case POWER_SUPPLY_PROP_HEALTH:
-		if (client->flags & SBS_FLAGS_TI_BQ20Z75)
+		if (chip->flags & SBS_FLAGS_TI_BQ20Z75)
 			ret = sbs_get_ti_battery_presence_and_health(client,
 								     psp, val);
 		else
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 4 lines · Michael Nosthoff

the type flag is stored in the chip->flags field not in the client->flags field. This currently leads to never using the ti specific function but always falling back to the general one.

Whoops! Sorry about that. Probably could add:

Fixes 76b16f4cdfb8 ("power: supply: sbs-battery: don't assume

MANUFACTURER_DATA formats")

and probably:

Also:

#2 lore raw
Quoted 4 lines · Brian Norris
Quoted 3 lines · Michael Nosthoff

the type flag is stored in the chip->flags field not in the client->flags field. This currently leads to never using the ti specific function but always falling back to the general one.

Also, the key point to why it will "never be used" is that the client (struct i2c_client) doesn't have a flag for BIT(0). See I2C_CLIENT_* flags, which start from 0x04.

Brian