[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <YfgMI2Qq4tMAiEn7@smile.fi.intel.com>
Date: Mon, 31 Jan 2022 18:19:47 +0200
From: Andy Shevchenko <andriy.shevchenko@...el.com>
To: Hans de Goede <hdegoede@...hat.com>
Cc: "Rafael J . Wysocki" <rafael@...nel.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Mark Gross <markgross@...nel.org>,
Andy Shevchenko <andy@...nel.org>,
Wolfram Sang <wsa@...nel.org>,
Lee Jones <lee.jones@...aro.org>,
Sebastian Reichel <sre@...nel.org>,
MyungJoo Ham <myungjoo.ham@...sung.com>,
Chanwoo Choi <cw00.choi@...sung.com>,
Ard Biesheuvel <ardb@...nel.org>, Len Brown <lenb@...nel.org>,
linux-acpi@...r.kernel.org, Yauhen Kharuzhy <jekhor@...il.com>,
Tsuchiya Yuto <kitakar@...il.com>,
Fabio Aiuto <fabioaiuto83@...il.com>,
platform-driver-x86@...r.kernel.org, linux-pm@...r.kernel.org,
linux-kernel@...r.kernel.org, linux-efi@...r.kernel.org
Subject: Re: [PATCH v4 12/20] power: supply: bq25890: Support higher charging
voltages through Pump Express+ protocol
On Mon, Jan 31, 2022 at 04:18:23PM +0100, Hans de Goede wrote:
> On 1/31/22 14:48, Andy Shevchenko wrote:
> > On Sun, Jan 30, 2022 at 09:45:49PM +0100, Hans de Goede wrote:
...
> >> + for (i = 0; i < PUMP_EXPRESS_MAX_TRIES; i++) {
> >
> >> + voltage = bq25890_get_vbus_voltage(bq);
> >> + if (voltage < 0)
> >> + goto error_print;
> >
> > It also can be (at least in align with the rest error paths)
> >
> > ret = bq25890_get_vbus_voltage(bq);
> > if (ret < 0)
> > goto error_print;
> > voltage = ret;
> >
> > followed up (but not necessarily)...
>
> The suggested pattern is useful when ret needs to be set on the error-exit
> path, but we are not doing that here. So I prefer to just keep this as is.
Are you talking about above proposal?
Still wouldn't be better to use it that if we want, for example, to print an
error code, it can be done easily? For the sake of consistency.
> >> + }
> >> +
> >> + bq25890_field_write(bq, F_PUMPX_EN, 0);
> >> +
> >> + dev_info(bq->dev, "Hi-voltage charging requested, input voltage is %d mV\n",
> >> + voltage);
> >
> >> + return;
> >> +error_print:
> >
> > if (ret < 0)
> >
> > But it's up to you.
> >
> >> + dev_err(bq->dev, "Failed to request hi-voltage charging\n");
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists