diff options
author | Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com> | 2018-06-13 12:05:17 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-06-14 17:08:03 -0700 |
commit | 27cad008406600822ab638980412ceea740e7fc8 (patch) | |
tree | 69d1f269bfeb0d253f4d90e6eee28c90f42736c4 /drivers/net/ethernet/xilinx | |
parent | 087fca595a0a30804fd7896e77ba11aa46e5d708 (diff) | |
download | linux-27cad008406600822ab638980412ceea740e7fc8.tar.bz2 |
net: emaclite: Fix MDIO bus unregister bug
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>
Diffstat (limited to 'drivers/net/ethernet/xilinx')
-rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c index 37989ce543ba..06eb6c886388 100644 --- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c +++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c @@ -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; |