linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: sbs-battery: use correct flags field
@ 2019-08-15 15:53 Michael Nosthoff
  2019-08-15 16:38 ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Michael Nosthoff @ 2019-08-15 15:53 UTC (permalink / raw)
  To: linux-pm; +Cc: briannorris, 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.

Signed-off-by: Michael Nosthoff <committed@heine.so>
---
 drivers/power/supply/sbs-battery.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c
index 048d205d7074..2e86cc1e0e35 100644
--- a/drivers/power/supply/sbs-battery.c
+++ b/drivers/power/supply/sbs-battery.c
@@ -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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] power: supply: sbs-battery: use correct flags field
  2019-08-15 15:53 [PATCH] power: supply: sbs-battery: use correct flags field Michael Nosthoff
@ 2019-08-15 16:38 ` Brian Norris
  2019-08-15 16:42   ` Brian Norris
  0 siblings, 1 reply; 3+ messages in thread
From: Brian Norris @ 2019-08-15 16:38 UTC (permalink / raw)
  To: Michael Nosthoff; +Cc: linux-pm

On Thu, Aug 15, 2019 at 8:53 AM Michael Nosthoff <committed@heine.so> wrote:
>
> 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:

Cc: <stable@vger.kernel.org>

Also:

Reviewed-by: Brian Norris <briannorris@chromium.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] power: supply: sbs-battery: use correct flags field
  2019-08-15 16:38 ` Brian Norris
@ 2019-08-15 16:42   ` Brian Norris
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Norris @ 2019-08-15 16:42 UTC (permalink / raw)
  To: Michael Nosthoff; +Cc: linux-pm

On Thu, Aug 15, 2019 at 9:38 AM Brian Norris <briannorris@chromium.org> wrote:
> On Thu, Aug 15, 2019 at 8:53 AM Michael Nosthoff <committed@heine.so> wrote:
> > 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-08-15 16:42 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-08-15 15:53 [PATCH] power: supply: sbs-battery: use correct flags field Michael Nosthoff
2019-08-15 16:38 ` Brian Norris
2019-08-15 16:42   ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).