[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <vy2jjh73agfhbovxt3isc626dru3daxwxba7gql6cj3ftpq2qx@pye5xiepzdc4>
Date: Sat, 29 Jun 2024 10:08:29 +0200
From: Uwe Kleine-König <u.kleine-koenig@...libre.com>
To: Peng Fan <peng.fan@....com>
Cc: "Peng Fan (OSS)" <peng.fan@....nxp.com>,
"linus.walleij@...aro.org" <linus.walleij@...aro.org>, "dan.carpenter@...aro.org" <dan.carpenter@...aro.org>,
"linux-gpio@...r.kernel.org" <linux-gpio@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org" <linux-arm-kernel@...ts.infradead.org>, "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Aisheng Dong <aisheng.dong@....com>, "festevam@...il.com" <festevam@...il.com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>, "kernel@...gutronix.de" <kernel@...gutronix.de>
Subject: Re: [PATCH V3 1/3] pinctrl: ti: iodelay: Use scope based
of_node_put() cleanups
Hello,
On Sat, Jun 29, 2024 at 01:32:15AM +0000, Peng Fan wrote:
> > Subject: Re: [PATCH V3 1/3] pinctrl: ti: iodelay: Use scope based
> > of_node_put() cleanups
> >
> > Hello Peng,
> >
> > On Thu, Jun 27, 2024 at 09:17:19PM +0800, Peng Fan (OSS) wrote:
> > > From: Peng Fan <peng.fan@....com>
> > >
> > > Use scope based of_node_put() cleanup to simplify code.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@....com>
> > > ---
> > > drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 43
> > > +++++++++----------------
> > > 1 file changed, 15 insertions(+), 28 deletions(-)
> > >
> > > diff --git a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> > > b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> > > index ef9758638501..f5e5a23d2226 100644
> > > --- a/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> > > +++ b/drivers/pinctrl/ti/pinctrl-ti-iodelay.c
> > > @@ -822,53 +822,48 @@ MODULE_DEVICE_TABLE(of,
> > ti_iodelay_of_match);
> > > static int ti_iodelay_probe(struct platform_device *pdev) {
> > > struct device *dev = &pdev->dev;
> > > - struct device_node *np = of_node_get(dev->of_node);
> > > + struct device_node *np __free(device_node) =
> > > +of_node_get(dev->of_node);
> >
> > of_node_put? -------------------------------------------^
>
> You mean use of_node_put here?
> of_node_get should be used here. The __free will automatically
> do of_node_put when function return.
Ah, I misinterpreted the syntax. I thought your code registers
of_node_get() as cleanup handler.
Sorry for the noise,
Uwe
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists