[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240108111503.GI132648@kernel.org>
Date: Mon, 8 Jan 2024 11:15:03 +0000
From: Simon Horman <horms@...nel.org>
To: Vladimir Oltean <olteanv@...il.com>
Cc: Arınç ÜNAL <arinc.unal@...nc9.com>,
Daniel Golle <daniel@...rotopia.org>,
Landen Chao <Landen.Chao@...iatek.com>,
DENG Qingfang <dqfext@...il.com>,
Sean Wang <sean.wang@...iatek.com>, Andrew Lunn <andrew@...n.ch>,
Florian Fainelli <f.fainelli@...il.com>,
"David S. Miller" <davem@...emloft.net>,
Eric Dumazet <edumazet@...gle.com>,
Jakub Kicinski <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>,
Matthias Brugger <matthias.bgg@...il.com>,
AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
David Bauer <mail@...id-bauer.net>, mithat.guner@...ont.com,
erkin.bozoglu@...ont.com,
Luiz Angelo Daros de Luca <luizluca@...il.com>,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org
Subject: Re: [PATCH net-next] net: dsa: mt7530: support OF-based registration
of switch MDIO bus
On Mon, Jan 08, 2024 at 01:00:00PM +0200, Vladimir Oltean wrote:
> On Mon, Jan 08, 2024 at 01:22:18PM +0300, Arınç ÜNAL wrote:
> > > > diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
> > > > index 391c4dbdff42..39d7e7ad7154 100644
> > > > --- a/drivers/net/dsa/mt7530.c
> > > > +++ b/drivers/net/dsa/mt7530.c
> > > > @@ -2153,17 +2153,25 @@ mt7530_free_irq(struct mt7530_priv *priv)
> > > > static int
> > > > mt7530_setup_mdio(struct mt7530_priv *priv)
> > > > {
> > > > + struct device_node *mnp, *np = priv->dev->of_node;
> > > > struct dsa_switch *ds = priv->ds;
> > > > struct device *dev = priv->dev;
> > > > struct mii_bus *bus;
> > > > static int idx;
> > > > - int ret;
> > > > + int ret = 0;
> > > > +
> > > > + mnp = of_get_child_by_name(np, "mdio");
> > > > +
> > > > + if (mnp && !of_device_is_available(mnp))
> > > > + goto out;
> > >
> > > nit: I think it would easier on the eyes to simply
> > >
> > > return 0;
>
> Actually "return 0" leaks "mnp". An of_node_put() is needed.
Yes, sorry for not noticing that.
Powered by blists - more mailing lists