diff options
author | Steve Glendinning <steve.glendinning@smsc.com> | 2008-12-25 19:40:19 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-12-25 19:40:19 -0500 |
commit | dd0451938815d8b901488b1058f52023892c6cde (patch) | |
tree | dbb70ece42aa24d11cbf567357080b1f13eb8c2f | |
parent | 6332178d91ca1a9dbd99bd97cabbcf965d178e9f (diff) |
smsc911x: fix BUG if module is removed while interface is up
If the module is removed while its interface is up, smsc911x_stop is not
called until after smsc911x_drv_remove has disposed of phy_dev. This
patch changes the stop method to handle this situation.
This is a different problem to the one reported by dfoley@telus.net.
Signed-off-by: Steve Glendinning <steve.glendinning@smsc.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/smsc911x.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c index ecdde03d4167..8078f3545f16 100644 --- a/drivers/net/smsc911x.c +++ b/drivers/net/smsc911x.c | |||
@@ -1267,8 +1267,6 @@ static int smsc911x_stop(struct net_device *dev) | |||
1267 | struct smsc911x_data *pdata = netdev_priv(dev); | 1267 | struct smsc911x_data *pdata = netdev_priv(dev); |
1268 | unsigned int temp; | 1268 | unsigned int temp; |
1269 | 1269 | ||
1270 | BUG_ON(!pdata->phy_dev); | ||
1271 | |||
1272 | /* Disable all device interrupts */ | 1270 | /* Disable all device interrupts */ |
1273 | temp = smsc911x_reg_read(pdata, INT_CFG); | 1271 | temp = smsc911x_reg_read(pdata, INT_CFG); |
1274 | temp &= ~INT_CFG_IRQ_EN_; | 1272 | temp &= ~INT_CFG_IRQ_EN_; |
@@ -1283,7 +1281,8 @@ static int smsc911x_stop(struct net_device *dev) | |||
1283 | smsc911x_tx_update_txcounters(dev); | 1281 | smsc911x_tx_update_txcounters(dev); |
1284 | 1282 | ||
1285 | /* Bring the PHY down */ | 1283 | /* Bring the PHY down */ |
1286 | phy_stop(pdata->phy_dev); | 1284 | if (pdata->phy_dev) |
1285 | phy_stop(pdata->phy_dev); | ||
1287 | 1286 | ||
1288 | SMSC_TRACE(IFDOWN, "Interface stopped"); | 1287 | SMSC_TRACE(IFDOWN, "Interface stopped"); |
1289 | return 0; | 1288 | return 0; |