]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: stmmac: mdio: use netdev_priv() directly
authorRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Wed, 27 Aug 2025 08:41:48 +0000 (09:41 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 28 Aug 2025 23:44:03 +0000 (16:44 -0700)
commitbafdd920a060eb1bad51c1c70b9850403548252f
tree223c184dbb114811ad327c777fb1f51fa45723f7
parent5e3aae2d3271cf5fd3e37683ff1392dd7bed5389
net: stmmac: mdio: use netdev_priv() directly

netdev_priv() is an inline function, taking a struct net_device
pointer. When passing in the MII bus->priv, which is a void pointer,
there is no need to go via a local ndev variable to type it first.

Thus, instead of:

struct net_device *ndev = bus->priv;
struct stmmac_priv *priv;
...
priv = netdev_priv(ndev);

we can simply do:

struct stmmac_priv *priv = netdev_priv(bus->priv);

which simplifies the code.

Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Subbaraya Sundeep <sbhatta@marvell.com>
Link: https://patch.msgid.link/E1urBj2-000000002as-0pod@rmk-PC.armlinux.org.uk
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/stmicro/stmmac/stmmac_mdio.c