From: Javier Carrasco <javier.carrasco.cruz@gmail.com>
To: Antoniu Miclaus <antoniu.miclaus@analog.com>,
Jean Delvare <jdelvare@suse.com>,
Guenter Roeck <linux@roeck-us.net>,
Tim Harvey <tharvey@gateworks.com>
Cc: linux-hwmon@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/2] hwmon: use device_for_each_child_node_scoped()
Date: Fri, 7 Jun 2024 23:00:19 +0200 [thread overview]
Message-ID: <0e0d9d44-d7f2-4dc0-9851-06b1f7290976@gmail.com> (raw)
In-Reply-To: <20240404-hwmon_device_for_each_child_node_scoped-v1-0-53997abde43c@gmail.com>
On 04/04/2024 13:13, Javier Carrasco wrote:
> Switch to the _scoped() version introduced in commit 365130fd47af
> ("device property: Introduce device_for_each_child_node_scoped()")
> to remove the need for manual calling of fwnode_handle_put() in the
> paths where the code exits the loop early.
>
> There are only two users of the non scoped version in the hwmon
> subsystem:
>
> - ltc2991
> - gsc-hwmon
>
> All calls of fwnode_handle_put() were in error paths.
>
> This series is based on the master branch of linux-next (next-20240404)
> to profif from the scoped version of device_for_each_child_node().
>
> Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
> ---
> Javier Carrasco (2):
> hwmon: (ltc2991) use device_for_each_child_node_scoped()
> hwmon: (gsc-hwmon) use device_for_each_child_node_scoped()
>
> drivers/hwmon/gsc-hwmon.c | 7 +------
> drivers/hwmon/ltc2991.c | 11 +++--------
> 2 files changed, 4 insertions(+), 14 deletions(-)
> ---
> base-commit: 2b3d5988ae2cb5cd945ddbc653f0a71706231fdd
> change-id: 20240404-hwmon_device_for_each_child_node_scoped-6e581c1d8a31
>
> Best regards,
Hi, this patch appears as "superseded" in the patchwork, but I could not
find what series actually superseded it.
I just noticed that the cleanup in ltc2991.c turns out to be a bug fix
as well because there is an error path if "shunt-resistor-micro-ohms" is
zero that misses the required fwnode_handle_put().
This is something similar like the recently applied fix for the ltc2992
[1], but in this case the _scoped() macro already exists and is in use
in the mainline kernel, and no explicit call to fwnode_handle_put() is
required unless the fix is to be ported to old kernels that don't have
the device_for_each_child_node_scoped() macro.
Link:
https://lore.kernel.org/linux-hwmon/20240523-fwnode_for_each_available_child_node_scoped-v2-0-701f3a03f2fb@gmail.com/
[1]
Best regards,
Javier Carrasco
next prev parent reply other threads:[~2024-06-07 21:00 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-04 11:13 Javier Carrasco
2024-04-04 11:13 ` [PATCH 1/2] hwmon: (ltc2991) " Javier Carrasco
2024-06-07 22:08 ` Guenter Roeck
2024-04-04 11:13 ` [PATCH 2/2] hwmon: (gsc-hwmon) " Javier Carrasco
2024-06-07 22:09 ` Guenter Roeck
2024-06-07 21:00 ` Javier Carrasco [this message]
2024-06-07 22:11 ` [PATCH 0/2] hwmon: " Guenter Roeck
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=0e0d9d44-d7f2-4dc0-9851-06b1f7290976@gmail.com \
--to=javier.carrasco.cruz@gmail.com \
--cc=antoniu.miclaus@analog.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@roeck-us.net \
--cc=tharvey@gateworks.com \
/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®