[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250904090056.q2w7ufpnkx33leab@DEN-DL-M70577>
Date: Thu, 4 Sep 2025 09:00:56 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Rosen Penev <rosenp@...il.com>
CC: Jakub Kicinski <kuba@...nel.org>, <netdev@...r.kernel.org>, Horatiu Vultur
<horatiu.vultur@...rochip.com>, "maintainer:MICROCHIP LAN966X ETHERNET
DRIVER" <UNGLinuxDriver@...rochip.com>, Andrew Lunn <andrew+netdev@...n.ch>,
"David S. Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>,
Paolo Abeni <pabeni@...hat.com>, Russell King <linux@...linux.org.uk>
Subject: Re: [PATCHv2 net-next 2/2] net: lan966x: convert fwnode to of
> On Wed, Sep 3, 2025 at 4:55 PM Jakub Kicinski <kuba@...nel.org> wrote:
> >
> > On Mon, 1 Sep 2025 13:20:01 -0700 Rosen Penev wrote:
> > > This is a purely OF driver. There's no need for fwnode to handle any of
> > > this, with the exception being phylik_create. Use of_fwnode_handle for
> > > that.
> >
> > Not sure this is worth cleaning up, but I'm not an OF API expert.
> > It's pretty odd that you're sneaking in an extra error check in
> > such a cleanup patch without even mentioning it.
> git grep shows most drivers handling the error.
>
> git grep of_get_phy_mode drivers/ | grep -v = | wc -l
> 7
> git grep \ =\ of_get_phy_mode drivers/ | wc -l
> 48
>
> I don't see why it should be different here.
>
> Actually without handling the error, phy_mode gets used unassigned in
> lan966x_probe_port
>
> The fwnode API is different as it conflates int and phy_connection_t
> as the same thing.
> > --
> > pw-bot: cr
About the added error check - I agree with Jakub that this deserves to be
mentioned, and should be a patch on its own.
I did some testing on lan966x, and before the added error check, it was
actually possible to omit phy-mode from the DT, and still have a valid port
configuration - but then again, the bindings documents phy-mode as a required
property.. maybe this should be enforced in the code.
As for the fwnode -> of changes, those looks good to me.
/Daniel
Powered by blists - more mailing lists