]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: stmmac: remove plat_dat->port_node
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Fri, 27 Feb 2026 09:53:13 +0000 (09:53 +0000)
committerJakub Kicinski <kuba@kernel.org>
Tue, 3 Mar 2026 02:35:05 +0000 (18:35 -0800)
commit44a2ec96d374806ee74454ea915615536a76b152
tree926313e0975574f39de65bbc4f62b53b63593cfd
parent940ec40dd299bba05bc022cf8e951de8a0f8b124
net: stmmac: remove plat_dat->port_node

There are repeated instances of:

fwnode = priv->plat->port_node;
if (!fwnode)
fwnode = dev_fwnode(priv->device);

However, the only place that ->port_node is set is
stmmac_probe_config_dt():

struct device_node *np = pdev->dev.of_node;
...
/* PHYLINK automatically parses the phy-handle property */
plat->port_node = of_fwnode_handle(np);

which is equivalent to dev_fwnode(&pdev->dev) and, as priv->device
will be &pdev->dev, is also equivalent to dev_fwnode(priv->device).

Thus, plat_dat->port_node doesn't provide any extra benefit over
using dev_fwnode(priv->device) directly.

There is one case where port_node is used directly, which can be
found in stmmac_pcs_setup(). This may cause a change of behaviour
as PCI drivers do not populate plat_dat->port_node, but
dev_fwnode(priv->device) may be valid. PCI-based stmmac should
be tested.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Link: https://patch.msgid.link/E1vvuX3-0000000Avme-3oej@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c
drivers/net/ethernet/stmicro/stmmac/stmmac_platform.c
include/linux/stmmac.h