Re: [PATCH] power: supply: bq27xxx: Return the value instead of -ENODATA

2021-04-01 Thread Pali Rohár
On Thursday 01 April 2021 01:51:28 Hermes Zhang wrote: > On 3/31/21 10:02 PM, Pali Rohár wrote: > > @@ -1655,9 +1655,6 @@ static int bq27xxx_battery_read_time(struct > > bq27xxx_device_info *di, u8 reg) > > return tval; > > } > > > > - if (tval == 65535) > > - return

Re: [PATCH] power: supply: bq27xxx: Return the value instead of -ENODATA

2021-03-31 Thread Hermes Zhang
On 3/31/21 10:02 PM, Pali Rohár wrote: > @@ -1655,9 +1655,6 @@ static int bq27xxx_battery_read_time(struct > bq27xxx_device_info *di, u8 reg) > return tval; > } > > - if (tval == 65535) > - return -ENODATA; > - > return tval * 60; > I'm not sure if this

Re: [PATCH] power: supply: bq27xxx: Return the value instead of -ENODATA

2021-03-31 Thread Pali Rohár
On Wednesday 31 March 2021 21:51:41 Hermes Zhang wrote: > From: Hermes Zhang > > It might be better to return value (e.g. 65535) instead of an error > (e.g. No data available) for the time property. > > Normally a common function will handle the read string and parse to > integer for all the

[PATCH] power: supply: bq27xxx: Return the value instead of -ENODATA

2021-03-31 Thread Hermes Zhang
From: Hermes Zhang It might be better to return value (e.g. 65535) instead of an error (e.g. No data available) for the time property. Normally a common function will handle the read string and parse to integer for all the properties, but will have problem when read the time property because