Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 300557
b: refs/heads/master
c: 308f288
h: refs/heads/master
i:
  300555: 6b2e3b6
v: v3
  • Loading branch information
Francois Romieu committed Apr 7, 2012
1 parent 794d479 commit ddd8f04
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 19 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ebaf7f8f78e8600b56010121766ed832f2f57b0f
refs/heads/master: 308f2888a3ff442167e2aea419225445b7a1b8b6
34 changes: 16 additions & 18 deletions trunk/drivers/net/ethernet/dec/tulip/de2104x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1380,6 +1380,7 @@ static void de_free_rings (struct de_private *de)
static int de_open (struct net_device *dev)
{
struct de_private *de = netdev_priv(dev);
const int irq = de->pdev->irq;
int rc;

netif_dbg(de, ifup, dev, "enabling interface\n");
Expand All @@ -1394,10 +1395,9 @@ static int de_open (struct net_device *dev)

dw32(IntrMask, 0);

rc = request_irq(dev->irq, de_interrupt, IRQF_SHARED, dev->name, dev);
rc = request_irq(irq, de_interrupt, IRQF_SHARED, dev->name, dev);
if (rc) {
netdev_err(dev, "IRQ %d request failure, err=%d\n",
dev->irq, rc);
netdev_err(dev, "IRQ %d request failure, err=%d\n", irq, rc);
goto err_out_free;
}

Expand All @@ -1413,7 +1413,7 @@ static int de_open (struct net_device *dev)
return 0;

err_out_free_irq:
free_irq(dev->irq, dev);
free_irq(irq, dev);
err_out_free:
de_free_rings(de);
return rc;
Expand All @@ -1434,7 +1434,7 @@ static int de_close (struct net_device *dev)
netif_carrier_off(dev);
spin_unlock_irqrestore(&de->lock, flags);

free_irq(dev->irq, dev);
free_irq(de->pdev->irq, dev);

de_free_rings(de);
de_adapter_sleep(de);
Expand All @@ -1444,27 +1444,28 @@ static int de_close (struct net_device *dev)
static void de_tx_timeout (struct net_device *dev)
{
struct de_private *de = netdev_priv(dev);
const int irq = de->pdev->irq;

netdev_dbg(dev, "NIC status %08x mode %08x sia %08x desc %u/%u/%u\n",
dr32(MacStatus), dr32(MacMode), dr32(SIAStatus),
de->rx_tail, de->tx_head, de->tx_tail);

del_timer_sync(&de->media_timer);

disable_irq(dev->irq);
disable_irq(irq);
spin_lock_irq(&de->lock);

de_stop_hw(de);
netif_stop_queue(dev);
netif_carrier_off(dev);

spin_unlock_irq(&de->lock);
enable_irq(dev->irq);
enable_irq(irq);

/* Update the error counts. */
__de_get_stats(de);

synchronize_irq(dev->irq);
synchronize_irq(irq);
de_clean_rings(de);

de_init_rings(de);
Expand Down Expand Up @@ -2024,8 +2025,6 @@ static int __devinit de_init_one (struct pci_dev *pdev,
goto err_out_res;
}

dev->irq = pdev->irq;

/* obtain and check validity of PCI I/O address */
pciaddr = pci_resource_start(pdev, 1);
if (!pciaddr) {
Expand All @@ -2050,7 +2049,6 @@ static int __devinit de_init_one (struct pci_dev *pdev,
pciaddr, pci_name(pdev));
goto err_out_res;
}
dev->base_addr = (unsigned long) regs;
de->regs = regs;

de_adapter_wake(de);
Expand Down Expand Up @@ -2078,11 +2076,9 @@ static int __devinit de_init_one (struct pci_dev *pdev,
goto err_out_iomap;

/* print info about board and interface just registered */
netdev_info(dev, "%s at 0x%lx, %pM, IRQ %d\n",
netdev_info(dev, "%s at %p, %pM, IRQ %d\n",
de->de21040 ? "21040" : "21041",
dev->base_addr,
dev->dev_addr,
dev->irq);
regs, dev->dev_addr, pdev->irq);

pci_set_drvdata(pdev, dev);

Expand Down Expand Up @@ -2130,9 +2126,11 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)

rtnl_lock();
if (netif_running (dev)) {
const int irq = pdev->irq;

del_timer_sync(&de->media_timer);

disable_irq(dev->irq);
disable_irq(irq);
spin_lock_irq(&de->lock);

de_stop_hw(de);
Expand All @@ -2141,12 +2139,12 @@ static int de_suspend (struct pci_dev *pdev, pm_message_t state)
netif_carrier_off(dev);

spin_unlock_irq(&de->lock);
enable_irq(dev->irq);
enable_irq(irq);

/* Update the error counts. */
__de_get_stats(de);

synchronize_irq(dev->irq);
synchronize_irq(irq);
de_clean_rings(de);

de_adapter_sleep(de);
Expand Down

0 comments on commit ddd8f04

Please sign in to comment.