3c59x: Get rid of "Trying to free already-free IRQ"
[pandora-kernel.git] / drivers / net / 3c59x.c
index 4567588..b9eeadf 100644 (file)
@@ -716,8 +716,10 @@ static int mdio_read(struct net_device *dev, int phy_id, int location);
 static void mdio_write(struct net_device *vp, int phy_id, int location, int value);
 static void vortex_timer(unsigned long arg);
 static void rx_oom_timer(unsigned long arg);
-static int vortex_start_xmit(struct sk_buff *skb, struct net_device *dev);
-static int boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev);
+static netdev_tx_t vortex_start_xmit(struct sk_buff *skb,
+                                    struct net_device *dev);
+static netdev_tx_t boomerang_start_xmit(struct sk_buff *skb,
+                                       struct net_device *dev);
 static int vortex_rx(struct net_device *dev);
 static int boomerang_rx(struct net_device *dev);
 static irqreturn_t vortex_interrupt(int irq, void *dev_id);
@@ -811,10 +813,10 @@ static int vortex_suspend(struct pci_dev *pdev, pm_message_t state)
                if (netif_running(dev)) {
                        netif_device_detach(dev);
                        vortex_down(dev, 1);
+                       disable_irq(dev->irq);
                }
                pci_save_state(pdev);
                pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
-               free_irq(dev->irq, dev);
                pci_disable_device(pdev);
                pci_set_power_state(pdev, pci_choose_state(pdev, state));
        }
@@ -837,18 +839,12 @@ static int vortex_resume(struct pci_dev *pdev)
                        return err;
                }
                pci_set_master(pdev);
-               if (request_irq(dev->irq, vp->full_bus_master_rx ?
-                               &boomerang_interrupt : &vortex_interrupt, IRQF_SHARED, dev->name, dev)) {
-                       pr_warning("%s: Could not reserve IRQ %d\n", dev->name, dev->irq);
-                       pci_disable_device(pdev);
-                       return -EBUSY;
-               }
                if (netif_running(dev)) {
                        err = vortex_up(dev);
                        if (err)
                                return err;
-                       else
-                               netif_device_attach(dev);
+                       enable_irq(dev->irq);
+                       netif_device_attach(dev);
                }
        }
        return 0;
@@ -2035,7 +2031,7 @@ vortex_error(struct net_device *dev, int status)
        }
 }
 
-static int
+static netdev_tx_t
 vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct vortex_private *vp = netdev_priv(dev);
@@ -2087,10 +2083,10 @@ vortex_start_xmit(struct sk_buff *skb, struct net_device *dev)
                        iowrite8(0x00, ioaddr + TxStatus); /* Pop the status stack. */
                }
        }
-       return 0;
+       return NETDEV_TX_OK;
 }
 
-static int
+static netdev_tx_t
 boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
        struct vortex_private *vp = netdev_priv(dev);
@@ -2177,7 +2173,7 @@ boomerang_start_xmit(struct sk_buff *skb, struct net_device *dev)
        iowrite16(DownUnstall, ioaddr + EL3_CMD);
        spin_unlock_irqrestore(&vp->lock, flags);
        dev->trans_start = jiffies;
-       return 0;
+       return NETDEV_TX_OK;
 }
 
 /* The interrupt handler does all of the Rx thread work and cleans up