diff options
author | Jorge Boncompte [DTI2] <jorge@dti2.net> | 2008-06-16 20:16:35 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2008-06-16 20:16:35 -0400 |
commit | d6c1d704ab5d2e13bebb096e415156a9c54a3d32 (patch) | |
tree | 419bdb2e79ae6be235956279a155e4337a4438a4 | |
parent | c0ed0b60f2c36acfebb53384a3b24d13b3a09309 (diff) |
atm: [iphase] doesn't call phy->start due to a bogus #ifndef
This causes the suni driver to oops if you try to use sonetdiag to get
the statistics. Also add the corresponding phy->stop call to fix another
oops if you try to remove the module.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: Chas Williams <chas@cmf.nrl.navy.mil>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/atm/iphase.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c index 800c09e128ee..139fce6968a6 100644 --- a/drivers/atm/iphase.c +++ b/drivers/atm/iphase.c | |||
@@ -2562,17 +2562,11 @@ static int __devinit ia_start(struct atm_dev *dev) | |||
2562 | error = suni_init(dev); | 2562 | error = suni_init(dev); |
2563 | if (error) | 2563 | if (error) |
2564 | goto err_free_rx; | 2564 | goto err_free_rx; |
2565 | /* | 2565 | if (dev->phy->start) { |
2566 | * Enable interrupt on loss of signal | 2566 | error = dev->phy->start(dev); |
2567 | * SUNI_RSOP_CIE - 0x10 | 2567 | if (error) |
2568 | * SUNI_RSOP_CIE_LOSE - 0x04 | 2568 | goto err_free_rx; |
2569 | */ | 2569 | } |
2570 | ia_phy_put(dev, ia_phy_get(dev, 0x10) | 0x04, 0x10); | ||
2571 | #ifndef MODULE | ||
2572 | error = dev->phy->start(dev); | ||
2573 | if (error) | ||
2574 | goto err_free_rx; | ||
2575 | #endif | ||
2576 | /* Get iadev->carrier_detect status */ | 2570 | /* Get iadev->carrier_detect status */ |
2577 | IaFrontEndIntr(iadev); | 2571 | IaFrontEndIntr(iadev); |
2578 | } | 2572 | } |
@@ -3238,9 +3232,14 @@ static void __devexit ia_remove_one(struct pci_dev *pdev) | |||
3238 | struct atm_dev *dev = pci_get_drvdata(pdev); | 3232 | struct atm_dev *dev = pci_get_drvdata(pdev); |
3239 | IADEV *iadev = INPH_IA_DEV(dev); | 3233 | IADEV *iadev = INPH_IA_DEV(dev); |
3240 | 3234 | ||
3241 | ia_phy_put(dev, ia_phy_get(dev,0x10) & ~(0x4), 0x10); | 3235 | /* Disable phy interrupts */ |
3236 | ia_phy_put(dev, ia_phy_get(dev, SUNI_RSOP_CIE) & ~(SUNI_RSOP_CIE_LOSE), | ||
3237 | SUNI_RSOP_CIE); | ||
3242 | udelay(1); | 3238 | udelay(1); |
3243 | 3239 | ||
3240 | if (dev->phy && dev->phy->stop) | ||
3241 | dev->phy->stop(dev); | ||
3242 | |||
3244 | /* De-register device */ | 3243 | /* De-register device */ |
3245 | free_irq(iadev->irq, dev); | 3244 | free_irq(iadev->irq, dev); |
3246 | iadev_count--; | 3245 | iadev_count--; |