Skip to contentSkip to conversation

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

PATCH In review Michael Nosthoff 3 participants 3 messages Aug 16, 2019 – Sep 2, 2019

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 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 health function as client->flags doesn't use that bit. So it's always falling back to the general one.

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

MANUFACTURER_DATA formats")

---
Changes since v1:
* Changed comment according to Brian's suggestions
* Added Fixes tag
* Added reviewed and cc stable

 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 Enric Balletbo i Serra on v2 1/1
#1 lore raw

Hi Michael,

I think that Sebastian is expected to be cc'ed, so adding him (otherwise he can miss your patch)

Missatge de Michael Nosthoff <[email protected]> del dia dv., 16 d’ag. 2019 a les 9:38:

Quoted 6 lines

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 health function as client->flags doesn't use that bit. So it's always falling back to the general one.

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

MANUFACTURER_DATA formats")

Found this patch while looking at another issue and LGTM, so in case this helps the patch landing

Thanks,
Enric

Quoted 25 lines

---
Changes since v1:
* Changed comment according to Brian's suggestions
* Added Fixes tag
* Added reviewed and cc stable

 drivers/power/supply/sbs-battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/supply/sbs-battery.c +1 -2
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
--

2.20.1

#2 lore raw
In reply to Michael Nosthoff

Hi,

Quoted 5 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 health function as client->flags doesn't use that bit. So it's always falling back to the general one.

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

MANUFACTURER_DATA formats")

---

Thanks, queued.

-- Sebastian

Quoted 24 lines

Changes since v1:
* Changed comment according to Brian's suggestions
* Added Fixes tag
* Added reviewed and cc stable

 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