From: Simon Horman <horms@kernel.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: "Arınç ÜNAL" <arinc.unal@arinc9.com>,
"Daniel Golle" <daniel@makrotopia.org>,
"Landen Chao" <Landen.Chao@mediatek.com>,
"DENG Qingfang" <dqfext@gmail.com>,
"Sean Wang" <sean.wang@mediatek.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"David Bauer" <mail@david-bauer.net>,
mithat.guner@xeront.com, erkin.bozoglu@xeront.com,
"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next] net: dsa: mt7530: support OF-based registration of switch MDIO bus
Date: Mon, 8 Jan 2024 11:15:03 +0000 [thread overview]
Message-ID: <20240108111503.GI132648@kernel.org> (raw)
In-Reply-To: <20240108110000.aujqhlufehngtkjj@skbuf>
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.
WARNING: multiple messages have this Message-ID (diff)
From: Simon Horman <horms@kernel.org>
To: Vladimir Oltean <olteanv@gmail.com>
Cc: "Arınç ÜNAL" <arinc.unal@arinc9.com>,
"Daniel Golle" <daniel@makrotopia.org>,
"Landen Chao" <Landen.Chao@mediatek.com>,
"DENG Qingfang" <dqfext@gmail.com>,
"Sean Wang" <sean.wang@mediatek.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Florian Fainelli" <f.fainelli@gmail.com>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Matthias Brugger" <matthias.bgg@gmail.com>,
"AngeloGioacchino Del Regno"
<angelogioacchino.delregno@collabora.com>,
"David Bauer" <mail@david-bauer.net>,
mithat.guner@xeront.com, erkin.bozoglu@xeront.com,
"Luiz Angelo Daros de Luca" <luizluca@gmail.com>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH net-next] net: dsa: mt7530: support OF-based registration of switch MDIO bus
Date: Mon, 8 Jan 2024 11:15:03 +0000 [thread overview]
Message-ID: <20240108111503.GI132648@kernel.org> (raw)
In-Reply-To: <20240108110000.aujqhlufehngtkjj@skbuf>
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.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2024-01-08 11:15 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-06 12:21 [PATCH net-next] net: dsa: mt7530: support OF-based registration of switch MDIO bus Arınç ÜNAL
2024-01-06 12:21 ` Arınç ÜNAL
2024-01-06 12:27 ` Arınç ÜNAL
2024-01-06 12:27 ` Arınç ÜNAL
2024-01-07 19:52 ` Simon Horman
2024-01-07 19:52 ` Simon Horman
2024-01-08 10:22 ` Arınç ÜNAL
2024-01-08 10:22 ` Arınç ÜNAL
2024-01-08 11:00 ` Vladimir Oltean
2024-01-08 11:00 ` Vladimir Oltean
2024-01-08 11:15 ` Simon Horman [this message]
2024-01-08 11:15 ` Simon Horman
2024-01-08 12:14 ` Arınç ÜNAL
2024-01-08 12:14 ` Arınç ÜNAL
2024-01-08 12:34 ` Vladimir Oltean
2024-01-08 12:34 ` Vladimir Oltean
-- strict thread matches above, loose matches on Subject: below --
2024-01-22 5:34 Arınç ÜNAL
2024-01-22 5:34 ` Arınç ÜNAL
2024-01-25 9:22 ` Vladimir Oltean
2024-01-25 9:22 ` Vladimir Oltean
2024-01-25 15:00 ` patchwork-bot+netdevbpf
2024-01-25 15:00 ` patchwork-bot+netdevbpf
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=20240108111503.GI132648@kernel.org \
--to=horms@kernel.org \
--cc=Landen.Chao@mediatek.com \
--cc=andrew@lunn.ch \
--cc=angelogioacchino.delregno@collabora.com \
--cc=arinc.unal@arinc9.com \
--cc=daniel@makrotopia.org \
--cc=davem@davemloft.net \
--cc=dqfext@gmail.com \
--cc=edumazet@google.com \
--cc=erkin.bozoglu@xeront.com \
--cc=f.fainelli@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=luizluca@gmail.com \
--cc=mail@david-bauer.net \
--cc=matthias.bgg@gmail.com \
--cc=mithat.guner@xeront.com \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=sean.wang@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.