lkml.org 
[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v3 3/3] power: supply: add CellWise cw2015 fuel gauge driver
From
Date
Hi Andy,

thanks for reviewing again.

>> + /* wait for gauge to become ready */
>> + for (i = 0; i < CW2015_READ_TRIES; i++) {
>> + ret = regmap_read(cw_bat->regmap, CW2015_REG_SOC, &reg_val);
>> + if (ret)
>> + return ret;
>> + /* SoC must not be more than 100% */
>> + else if (reg_val <= 100)
>> + break;
>> +
>> + msleep(100);
>> + }
>
> Have you considered to use regmap_read_poll_timeout()?

Neat! That is a much cleaner solution. Will use that in v4.

>
>> +
>> + if (i >= CW2015_READ_TRIES) {
>> + reg_val = CW2015_MODE_SLEEP;
>> + regmap_write(cw_bat->regmap, CW2015_REG_MODE, reg_val);
>> + dev_err(cw_bat->dev,
>> + "Gauge did not become ready after profile upload");
>> + return -ETIMEDOUT;
>> + }
>
> ...
>
>> + if (memcmp(bat_info, cw_bat->bat_profile,
>> + CW2015_SIZE_BATINFO)) {
>
> I think it's pretty much okay to have this on one line, disregard 80 limit
> (it's only 1 extra).

Ok, will probably do that in a few places.


Best Regards,

Tobias

\
 
 \ /
  Last update: 2020-03-12 00:51    [W:0.081 / U:0.520 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site