From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
"zhangzekun (A)" <zhangzekun11@huawei.com>,
Oleksij Rempel <o.rempel@pengutronix.de>,
robh@kernel.org, saravanak@google.com, justin.chen@broadcom.com,
florian.fainelli@broadcom.com, andrew+netdev@lunn.ch,
kuba@kernel.org, kory.maincent@bootlin.com,
jacopo+renesas@jmondi.org,
kieran.bingham+renesas@ideasonboard.com, maddy@linux.ibm.com,
mpe@ellerman.id.au, npiggin@gmail.com, olteanv@gmail.com,
davem@davemloft.net, taras.chornyi@plvision.eu,
edumazet@google.com, pabeni@redhat.com, sudeep.holla@arm.com,
cristian.marussi@arm.com, arm-scmi@vger.kernel.org,
linuxppc-dev@lists.ozlabs.org, linux-media@vger.kernel.org,
netdev@vger.kernel.org, devicetree@vger.kernel.org,
chenjun102@huawei.com, Joe Hattori <joe@pf.is.s.u-tokyo.ac.jp>,
Krzysztof Kozlowski <krzk@kernel.org>
Subject: Re: [PATCH 1/9] of: Add warpper function of_find_node_by_name_balanced()
Date: Tue, 10 Jun 2025 22:39:31 +0300 [thread overview]
Message-ID: <aEiJ856egeMCC6ao@black.fi.intel.com> (raw)
In-Reply-To: <20250425170732.GA21390@pendragon.ideasonboard.com>
On Fri, Apr 25, 2025 at 08:07:32PM +0300, Laurent Pinchart wrote:
> On Fri, Apr 25, 2025 at 06:30:10PM +0300, Dan Carpenter wrote:
> > Whatever happened with this thread from Feb.
> > https://lore.kernel.org/all/20250207013117.104205-1-zhangzekun11@huawei.com/
> >
> > The issue was that people weren't expecting of_find_node_by_name() to
> > drop the reference on the of_node. The patchset introduced a wrapper
> > which basically worked as expected except no liked the naming. Krzysztof
> > suggested that maybe the callers should be using of_get_child_by_name()
> > instead.
>
> My conclusion is that most of the users of of_find_node_by_name() with a
> non-NULL first argument are wrong, and should be replaced by
> of_get_child_by_name(). We need a volunteer to do that work.
Wouldn't be coccinelle a good worker for this job done?
> > I created a Smatch warning for this and here are the four issues it
> > found. The line numbers are from linux-next.
> >
> > drivers/net/ethernet/broadcom/asp2/bcmasp.c:1370 bcmasp_probe() warn: 'dev->of_node' was not incremented
> > drivers/net/pse-pd/tps23881.c:505 tps23881_get_of_channels() warn: 'priv->np' was not incremented
> > drivers/media/platform/qcom/venus/core.c:301 venus_add_video_core() warn: 'dev->of_node' was not incremented
> > drivers/regulator/tps6594-regulator.c:618 tps6594_regulator_probe() warn: 'tps->dev->of_node' was not incremented
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2025-06-10 19:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-07 1:31 [PATCH 0/9] Add wrapper function of_find_node_by_name_balanced() Zhang Zekun
2025-02-07 1:31 ` [PATCH 1/9] of: Add warpper " Zhang Zekun
2025-02-07 8:24 ` Oleksij Rempel
2025-02-07 8:57 ` Laurent Pinchart
2025-02-07 11:28 ` zhangzekun (A)
2025-02-07 15:37 ` Laurent Pinchart
2025-02-08 4:18 ` Dan Carpenter
2025-04-25 15:30 ` Dan Carpenter
2025-04-25 17:07 ` Laurent Pinchart
2025-06-10 19:39 ` Andy Shevchenko [this message]
2025-06-10 20:03 ` Laurent Pinchart
2025-06-10 20:17 ` Andy Shevchenko
2025-02-10 6:47 ` zhangzekun (A)
2025-02-10 10:03 ` Laurent Pinchart
2025-02-11 11:26 ` zhangzekun (A)
2025-02-11 11:43 ` Laurent Pinchart
2025-02-11 14:15 ` Rob Herring
2025-02-12 5:47 ` Krzysztof Kozlowski
2025-02-07 1:31 ` [PATCH 2/9] net: bcmasp: Add missing of_node_get() before of_find_node_by_name() Zhang Zekun
2025-02-12 5:52 ` Krzysztof Kozlowski
2025-02-12 6:50 ` zhangzekun (A)
2025-02-07 1:31 ` [PATCH 3/9] net: pse-pd: " Zhang Zekun
2025-02-07 1:31 ` [PATCH 4/9] media: max9286: Use of_find_node_by_name_balanced() to find device_node Zhang Zekun
2025-02-07 1:31 ` [PATCH 5/9] powerpc: " Zhang Zekun
2025-02-07 1:31 ` [PATCH 6/9] net: dsa: " Zhang Zekun
2025-02-07 1:31 ` [PATCH 7/9] net: dsa: hellcreek: " Zhang Zekun
2025-02-07 1:31 ` [PATCH 8/9] net: prestera: " Zhang Zekun
2025-02-07 1:31 ` [PATCH 9/9] regulator: scmi: " Zhang Zekun
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=aEiJ856egeMCC6ao@black.fi.intel.com \
--to=andriy.shevchenko@intel.com \
--cc=andrew+netdev@lunn.ch \
--cc=arm-scmi@vger.kernel.org \
--cc=chenjun102@huawei.com \
--cc=cristian.marussi@arm.com \
--cc=dan.carpenter@linaro.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=florian.fainelli@broadcom.com \
--cc=jacopo+renesas@jmondi.org \
--cc=joe@pf.is.s.u-tokyo.ac.jp \
--cc=justin.chen@broadcom.com \
--cc=kieran.bingham+renesas@ideasonboard.com \
--cc=kory.maincent@bootlin.com \
--cc=krzk@kernel.org \
--cc=kuba@kernel.org \
--cc=laurent.pinchart@ideasonboard.com \
--cc=linux-media@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=mpe@ellerman.id.au \
--cc=netdev@vger.kernel.org \
--cc=npiggin@gmail.com \
--cc=o.rempel@pengutronix.de \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=saravanak@google.com \
--cc=sudeep.holla@arm.com \
--cc=taras.chornyi@plvision.eu \
--cc=zhangzekun11@huawei.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;
as well as URLs for NNTP newsgroup(s).