mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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
6ca80638b9
("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>
This commit is contained in:
parent
04a4bc9ddd
commit
45f62ca5cc
@ -621,8 +621,6 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
|
||||
goto err_of_node_put;
|
||||
}
|
||||
|
||||
priv->master_mii_dn = dn;
|
||||
|
||||
priv->user_mii_bus = mdiobus_alloc();
|
||||
if (!priv->user_mii_bus) {
|
||||
err = -ENOMEM;
|
||||
@ -682,9 +680,11 @@ static int bcm_sf2_mdio_register(struct dsa_switch *ds)
|
||||
}
|
||||
|
||||
err = mdiobus_register(priv->user_mii_bus);
|
||||
if (err && dn)
|
||||
if (err)
|
||||
goto err_free_user_mii_bus;
|
||||
|
||||
of_node_put(dn);
|
||||
|
||||
return 0;
|
||||
|
||||
err_free_user_mii_bus:
|
||||
|
@ -107,7 +107,6 @@ struct bcm_sf2_priv {
|
||||
|
||||
/* Master and slave MDIO bus controller */
|
||||
unsigned int indir_phy_mask;
|
||||
struct device_node *master_mii_dn;
|
||||
struct mii_bus *user_mii_bus;
|
||||
struct mii_bus *master_mii_bus;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user