From: Guenter Roeck <linux@roeck-us.net>
To: Liang He <windhl@126.com>
Cc: tharvey@gateworks.com, rjones@gateworks.com, jdelvare@suse.com,
linux-hwmon@vger.kernel.org, chenmengda2009@163.com
Subject: Re: [PATCH] hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API
Date: Wed, 14 Sep 2022 23:59:10 -0700 [thread overview]
Message-ID: <20220915065910.GA4098423@roeck-us.net> (raw)
In-Reply-To: <20220915020245.4001047-1-windhl@126.com>
On Thu, Sep 15, 2022 at 10:02:45AM +0800, Liang He wrote:
> In gsc_hwmon_get_devtree_pdata(), we should call of_node_get() before
> the of_find_compatible_node() which will automatically call
> of_node_put() for the 'from' argument.
>
> Fixes: 3bce5377ef66 ("hwmon: Add Gateworks System Controller support")
> Signed-off-by: Liang He <windhl@126.com>
> Signed-off-by: Mengda Chen <chenmengda2009@163.com>
That second Signed-off-by: doesn't make sense in this context since
the patch is from and was sent by the first signer.
Guenter
> ---
> drivers/hwmon/gsc-hwmon.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/hwmon/gsc-hwmon.c b/drivers/hwmon/gsc-hwmon.c
> index d64be48f1ef6..b60ec95b5edb 100644
> --- a/drivers/hwmon/gsc-hwmon.c
> +++ b/drivers/hwmon/gsc-hwmon.c
> @@ -267,6 +267,7 @@ gsc_hwmon_get_devtree_pdata(struct device *dev)
> pdata->nchannels = nchannels;
>
> /* fan controller base address */
> + of_node_get(dev->parent->of_node);
> fan = of_find_compatible_node(dev->parent->of_node, NULL, "gw,gsc-fan");
> if (fan && of_property_read_u32(fan, "reg", &pdata->fan_base)) {
> of_node_put(fan);
> --
> 2.25.1
>
next prev parent reply other threads:[~2022-09-15 7:22 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 2:02 [PATCH] hwmon: (gsc-hwmon) Call of_node_get() before of_find_xxx API Liang He
2022-09-15 6:59 ` Guenter Roeck [this message]
2022-09-15 7:10 ` Liang He
2022-09-15 8:03 ` 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=20220915065910.GA4098423@roeck-us.net \
--to=linux@roeck-us.net \
--cc=chenmengda2009@163.com \
--cc=jdelvare@suse.com \
--cc=linux-hwmon@vger.kernel.org \
--cc=rjones@gateworks.com \
--cc=tharvey@gateworks.com \
--cc=windhl@126.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