]> git.itanic.dy.fi Git - linux-stable/commit
net: dsa: bcm_sf2: drop priv->master_mii_dn
authorVladimir Oltean <vladimir.oltean@nxp.com>
Thu, 4 Jan 2024 14:00:37 +0000 (16:00 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 5 Jan 2024 11:56:36 +0000 (11:56 +0000)
commit45f62ca5cc4861d084744e79642a4969848593eb
tree63554de5581154b2c1491de9e636cf2d620e1f8f
parent04a4bc9dddc7bd316ba555338c04b885581be5ae
net: dsa: bcm_sf2: drop priv->master_mii_dn

There used to be a of_node_put(priv->master_mii_dn) call in
bcm_sf2_mdio_unregister(), which was accidentally deleted in commit
6ca80638b90c ("net: dsa: Use conduit and user terms").

But it's not needed - we don't need to hold a reference on the
"brcm,unimac-mdio" OF node for that long, since we don't do anything
with it. We can release it as soon as we finish bcm_sf2_mdio_register().

Also reduce "if (err && dn)" to just "if (err)". We know "dn", aka the
former priv->master_mii_dn, is non-NULL. Otherwise, of_mdio_find_bus(dn)
would not have been able to find the bus behind "brcm,unimac-mdio".

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Alvin Šipraga <alsi@bang-olufsen.dk>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Luiz Angelo Daros de Luca <luizluca@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/bcm_sf2.h