Re: [PATCHv2 net-next 2/2] net: lan966x: convert fwnode to of
From: Rosen Penev <hidden>
Date: 2025-09-04 20:30:47
On Thu, Sep 4, 2025 at 2:01 AM Daniel Machon [off-list ref] wrote:
quoted
On Wed, Sep 3, 2025 at 4:55 PM Jakub Kicinski [off-list ref] wrote:quoted
On Mon, 1 Sep 2025 13:20:01 -0700 Rosen Penev wrote:quoted
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.quoted
-- pw-bot: crAbout the added error check - I agree with Jakub that this deserves to be mentioned, and should be a patch on its own.
Sounds like a fix for net instead of net-next. Not sure how that would work as both patches would conflict.
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.
Absolutely.
As for the fwnode -> of changes, those looks good to me. /Daniel