Skip to content

Commit

Permalink
net: bcmgenet: Utilize bcmgenet_mii_exit() for error path
Browse files Browse the repository at this point in the history
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: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Florian Fainelli authored and David S. Miller committed Jul 31, 2017
1 parent 2b13c3a commit 6f24b85
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions drivers/net/ethernet/broadcom/genet/bcmmii.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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;
}

Expand Down

0 comments on commit 6f24b85

Please sign in to comment.