diff options
author | Francois Romieu <romieu@fr.zoreil.com> | 2012-03-09 12:43:40 -0500 |
---|---|---|
committer | Francois Romieu <romieu@fr.zoreil.com> | 2012-04-07 05:45:26 -0400 |
commit | 0c18acc1ed57d54195427d16316d5ea09d840b0e (patch) | |
tree | ff5c9759564eabc44101d188b4b17b77ea201cdb /drivers/net/ethernet/packetengines | |
parent | a69afe3263717ba9384cf18d05722c598f6820af (diff) |
yellowfin: stop using net_device.{base_addr, irq}.
Signed-off-by: Francois Romieu <romieu@fr.zoreil.com>
Diffstat (limited to 'drivers/net/ethernet/packetengines')
-rw-r--r-- | drivers/net/ethernet/packetengines/yellowfin.c | 32 |
1 files changed, 14 insertions, 18 deletions
diff --git a/drivers/net/ethernet/packetengines/yellowfin.c b/drivers/net/ethernet/packetengines/yellowfin.c index 7757b80ef924..04e622fd468d 100644 --- a/drivers/net/ethernet/packetengines/yellowfin.c +++ b/drivers/net/ethernet/packetengines/yellowfin.c | |||
@@ -427,9 +427,6 @@ static int __devinit yellowfin_init_one(struct pci_dev *pdev, | |||
427 | /* Reset the chip. */ | 427 | /* Reset the chip. */ |
428 | iowrite32(0x80000000, ioaddr + DMACtrl); | 428 | iowrite32(0x80000000, ioaddr + DMACtrl); |
429 | 429 | ||
430 | dev->base_addr = (unsigned long)ioaddr; | ||
431 | dev->irq = irq; | ||
432 | |||
433 | pci_set_drvdata(pdev, dev); | 430 | pci_set_drvdata(pdev, dev); |
434 | spin_lock_init(&np->lock); | 431 | spin_lock_init(&np->lock); |
435 | 432 | ||
@@ -569,25 +566,20 @@ static void mdio_write(void __iomem *ioaddr, int phy_id, int location, int value | |||
569 | static int yellowfin_open(struct net_device *dev) | 566 | static int yellowfin_open(struct net_device *dev) |
570 | { | 567 | { |
571 | struct yellowfin_private *yp = netdev_priv(dev); | 568 | struct yellowfin_private *yp = netdev_priv(dev); |
569 | const int irq = yp->pci_dev->irq; | ||
572 | void __iomem *ioaddr = yp->base; | 570 | void __iomem *ioaddr = yp->base; |
573 | int i, ret; | 571 | int i, rc; |
574 | 572 | ||
575 | /* Reset the chip. */ | 573 | /* Reset the chip. */ |
576 | iowrite32(0x80000000, ioaddr + DMACtrl); | 574 | iowrite32(0x80000000, ioaddr + DMACtrl); |
577 | 575 | ||
578 | ret = request_irq(dev->irq, yellowfin_interrupt, IRQF_SHARED, dev->name, dev); | 576 | rc = request_irq(irq, yellowfin_interrupt, IRQF_SHARED, dev->name, dev); |
579 | if (ret) | 577 | if (rc) |
580 | return ret; | 578 | return rc; |
581 | |||
582 | if (yellowfin_debug > 1) | ||
583 | netdev_printk(KERN_DEBUG, dev, "%s() irq %d\n", | ||
584 | __func__, dev->irq); | ||
585 | 579 | ||
586 | ret = yellowfin_init_ring(dev); | 580 | rc = yellowfin_init_ring(dev); |
587 | if (ret) { | 581 | if (rc < 0) |
588 | free_irq(dev->irq, dev); | 582 | goto err_free_irq; |
589 | return ret; | ||
590 | } | ||
591 | 583 | ||
592 | iowrite32(yp->rx_ring_dma, ioaddr + RxPtr); | 584 | iowrite32(yp->rx_ring_dma, ioaddr + RxPtr); |
593 | iowrite32(yp->tx_ring_dma, ioaddr + TxPtr); | 585 | iowrite32(yp->tx_ring_dma, ioaddr + TxPtr); |
@@ -647,8 +639,12 @@ static int yellowfin_open(struct net_device *dev) | |||
647 | yp->timer.data = (unsigned long)dev; | 639 | yp->timer.data = (unsigned long)dev; |
648 | yp->timer.function = yellowfin_timer; /* timer handler */ | 640 | yp->timer.function = yellowfin_timer; /* timer handler */ |
649 | add_timer(&yp->timer); | 641 | add_timer(&yp->timer); |
642 | out: | ||
643 | return rc; | ||
650 | 644 | ||
651 | return 0; | 645 | err_free_irq: |
646 | free_irq(irq, dev); | ||
647 | goto out; | ||
652 | } | 648 | } |
653 | 649 | ||
654 | static void yellowfin_timer(unsigned long data) | 650 | static void yellowfin_timer(unsigned long data) |
@@ -1251,7 +1247,7 @@ static int yellowfin_close(struct net_device *dev) | |||
1251 | } | 1247 | } |
1252 | #endif /* __i386__ debugging only */ | 1248 | #endif /* __i386__ debugging only */ |
1253 | 1249 | ||
1254 | free_irq(dev->irq, dev); | 1250 | free_irq(yp->pci_dev->irq, dev); |
1255 | 1251 | ||
1256 | /* Free all the skbuffs in the Rx queue. */ | 1252 | /* Free all the skbuffs in the Rx queue. */ |
1257 | for (i = 0; i < RX_RING_SIZE; i++) { | 1253 | for (i = 0; i < RX_RING_SIZE; i++) { |