public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: Alexander Stein <alexander.stein@ew.tq-group.com>
To: Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Pengutronix Kernel Team <kernel@pengutronix.de>,
	Fabio Estevam <festevam@gmail.com>,
	Srinivas Kandagatla <srinivas.kandagatla@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>
Cc: devicetree@vger.kernel.org, imx@lists.linux.dev,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano
Date: Fri, 31 Jan 2025 14:50:46 +0100	[thread overview]
Message-ID: <4989387.31r3eYUQgx@steina-w> (raw)
In-Reply-To: <deef6dcd-27a0-4109-9788-a755fd390f55@kernel.org>

Hi,

Am Freitag, 31. Januar 2025, 08:20:40 CET schrieb Krzysztof Kozlowski:
> On 30/01/2025 14:01, Alexander Stein wrote:
> > +
> > +static int imx_ocotp_grant_access(struct ocotp_priv *priv, struct device_node *parent)
> > +{
> > +	struct device *dev = priv->dev;
> > +
> > +	for_each_available_child_of_node_scoped(parent, child) {
> > +		struct of_phandle_args args;
> > +		u32 id, idx = 0;
> > +
> > +		while (!of_parse_phandle_with_args(child, "access-controllers",
> > +						   "#access-controller-cells",
> > +						   idx++, &args)) {
> > +			of_node_put(args.np);
> > +			if (args.np != dev->of_node)
> 
> You are using args.np after dropping the reference.

Indeed, but is it really a problem? The args.np pointer is still the same.
So the comparison is unaffected.

Both branches need to drop the reference, no?
But the following looks awefull as well.
> if (args.np != dev->of_node) {
> 	of_node_put(args.np);
> 	continue;
> }
> of_node_put(args.np);

Best regards,
Alexander

> 
> > +				continue;
> > +
> > +			/* Only support one cell */
> > +			if (args.args_count != 1) {
> > +				dev_err(dev, "wrong args count\n");
> > +				continue;
> > +			}
> > +
> 
> 
> Best regards,
> Krzysztof
> 


-- 
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
http://www.tq-group.com/




  reply	other threads:[~2025-01-31 13:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 13:00 [PATCH 0/4] Make i.MX8M Nano OCOTP work as accessing controller Alexander Stein
2025-01-30 13:00 ` [PATCH 1/4] dt-bindings: nvmem: imx-ocotp: Add i.MX8M Nano access controller definitions Alexander Stein
2025-01-30 16:32   ` Frank Li
2025-01-30 18:47   ` Conor Dooley
2025-01-30 13:00 ` [PATCH 2/4] nvmem: imx-ocotp: Sort header alphabetically Alexander Stein
2025-01-30 16:33   ` Frank Li
2025-01-30 13:01 ` [PATCH 3/4] nvmem: imx-ocotp: Support accessing controller for i.MX8M Nano Alexander Stein
2025-01-30 16:42   ` Frank Li
2025-01-31 13:54     ` Alexander Stein
2025-01-31 16:06       ` Frank Li
2025-02-05  6:51         ` Alexander Stein
2025-02-05 16:43           ` Frank Li
2025-02-05 17:02             ` Frank Li
2025-01-31  7:20   ` Krzysztof Kozlowski
2025-01-31 13:50     ` Alexander Stein [this message]
2025-01-31 14:07       ` Krzysztof Kozlowski
2025-01-30 13:01 ` [PATCH 4/4] arm64: dts: imx8mn: Add access-controller references Alexander Stein
2025-01-30 23:38 ` [PATCH 0/4] Make i.MX8M Nano OCOTP work as accessing controller Rob Herring (Arm)

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=4989387.31r3eYUQgx@steina-w \
    --to=alexander.stein@ew.tq-group.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=festevam@gmail.com \
    --cc=imx@lists.linux.dev \
    --cc=kernel@pengutronix.de \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=srinivas.kandagatla@linaro.org \
    /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