Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6f24b85e authored by Florian Fainelli's avatar Florian Fainelli Committed by David S. Miller
Browse files

net: bcmgenet: Utilize bcmgenet_mii_exit() for error path



bcmgenet_mii_init() has an error path which is strictly identical to the
unwinding that bcmgenet_mii_exit() does, so have bcmgenet_mii_init()
utilize bcmgenet_mii_exit() for that.

Signed-off-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2b13c3ae
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -563,7 +563,6 @@ static int bcmgenet_mii_bus_init(struct bcmgenet_priv *priv)
int bcmgenet_mii_init(struct net_device *dev)
{
	struct bcmgenet_priv *priv = netdev_priv(dev);
	struct device_node *dn = priv->pdev->dev.of_node;
	int ret;

	ret = bcmgenet_mii_register(priv);
@@ -577,11 +576,7 @@ int bcmgenet_mii_init(struct net_device *dev)
	return 0;

out:
	if (of_phy_is_fixed_link(dn))
		of_phy_deregister_fixed_link(dn);
	of_node_put(priv->phy_dn);
	platform_device_unregister(priv->mii_pdev);
	platform_device_put(priv->mii_pdev);
	bcmgenet_mii_exit(dev);
	return ret;
}