Skip to content

Commit

Permalink
net: emaclite: Fix MDIO bus unregister bug
Browse files Browse the repository at this point in the history
Since 'has_mdio' flag is not used,sequence insmod->rmmod-> insmod
leads to failure as MDIO unregister doesn't happen in .remove().
Fix it by checking MII bus pointer instead.

Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Radhey Shyam Pandey authored and David S. Miller committed Jun 15, 2018
1 parent 087fca5 commit 27cad00
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/xilinx/xilinx_emaclite.c
Original file line number Diff line number Diff line change
Expand Up @@ -1191,7 +1191,7 @@ static int xemaclite_of_remove(struct platform_device *of_dev)
struct net_local *lp = netdev_priv(ndev);

/* Un-register the mii_bus, if configured */
if (lp->has_mdio) {
if (lp->mii_bus) {
mdiobus_unregister(lp->mii_bus);
mdiobus_free(lp->mii_bus);
lp->mii_bus = NULL;
Expand Down

0 comments on commit 27cad00

Please sign in to comment.