[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200807090819.GA1178@kunai>
Date: Fri, 7 Aug 2020 11:08:19 +0200
From: Wolfram Sang <wsa@...nel.org>
To: Stephen Kitt <steve@....org>
Cc: Guenter Roeck <linux@...ck-us.net>,
Jean Delvare <jdelvare@...e.com>, linux-hwmon@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] hwmon/pmbus: use simple i2c probe function
On Fri, Aug 07, 2020 at 09:45:26AM +0200, Stephen Kitt wrote:
> pmbus_do_probe doesn't use the id information provided in its second
> argument, so this can be removed, which then allows using the
> single-parameter i2c probe function ("probe_new") for probes.
>
> This avoids scanning the identifier tables during probes.
>
> Drivers which didn't use the id are converted as-is; drivers which did
> are modified as follows:
>
> * if the information in i2c_client is sufficient, that's used instead
> (client->name);
> * configured v. probed comparisons are performed by comparing the
> configured name to the detected name, instead of the ids; this
> involves strcmp but is still cheaper than comparing all the device
> names when scanning the tables;
> * anything else is handled by calling i2c_match_id() with the same
> level of error-handling (if any) as before.
>
> Signed-off-by: Stephen Kitt <steve@....org>
I haven't checked the patch in detail, just saying that the bulk move to
probe_new is much appreciated, so:
Acked-by: Wolfram Sang <wsa@...nel.org>
One thing hit my eye, though:
> if (md)
> vs = (enum versions)md;
> - else if (id)
> - vs = (enum versions)id->driver_data;
> + else {
> + id = i2c_match_id(ibm_cffps_id, client);
> + if (id)
> + vs = (enum versions)id->driver_data;
> + }
Missing braces in the if-block here. 'checkpatch --strict' warns about
it:
CHECK: Unbalanced braces around else statement
#230: FILE: drivers/hwmon/pmbus/ibm-cffps.c:490:
+ else {
Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)
Powered by blists - more mailing lists