From: Tobias Schramm <t.schramm@manjaro.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Tobias Schramm <t.schramm@manjaro.org>
Cc: Sebastian Reichel <sre@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
Maxime Ripard <mripard@kernel.org>,
Sam Ravnborg <sam@ravnborg.org>,
Heiko Stuebner <heiko.stuebner@theobroma-systems.com>,
Stephan Gerhold <stephan@gerhold.net>,
Mark Brown <broonie@kernel.org>,
Mauro Carvalho Chehab <mchehab+samsung@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jonathan Cameron <Jonathan.Cameron@huawei.com>,
linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/3] power: supply: add CellWise cw2015 fuel gauge driver
Date: Thu, 12 Mar 2020 00:51:28 +0100 [thread overview]
Message-ID: <c93db959-1e8d-9823-8a4f-71bfea12afaf@manjaro.org> (raw)
In-Reply-To: <20200311101830.GE1922688@smile.fi.intel.com>
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, ®_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
prev parent reply other threads:[~2020-03-11 23:50 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-11 9:30 [PATCH v3 0/3] Add support for CellWise cw2015 fuel gauge Tobias Schramm
2020-03-11 9:30 ` [PATCH v3 1/3] dt-bindings: Document cellwise vendor-prefix Tobias Schramm
2020-03-11 9:30 ` [PATCH v3 2/3] dt-bindings: power: supply: add cw2015_battery bindings Tobias Schramm
2020-03-11 17:20 ` Daniel Thompson
2020-03-11 23:17 ` Tobias Schramm
2020-03-12 10:17 ` Daniel Thompson
2020-03-11 9:30 ` [PATCH v3 3/3] power: supply: add CellWise cw2015 fuel gauge driver Tobias Schramm
2020-03-11 10:18 ` Andy Shevchenko
2020-03-11 10:22 ` Andy Shevchenko
2020-03-11 23:51 ` Tobias Schramm [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c93db959-1e8d-9823-8a4f-71bfea12afaf@manjaro.org \
--to=t.schramm@manjaro.org \
--cc=Jonathan.Cameron@huawei.com \
--cc=andriy.shevchenko@linux.intel.com \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=heiko.stuebner@theobroma-systems.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mchehab+samsung@kernel.org \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=sam@ravnborg.org \
--cc=sre@kernel.org \
--cc=stephan@gerhold.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®