aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/sundance.c
diff options
context:
space:
mode:
authorAuke Kok <auke-jan.h.kok@intel.com>2007-06-08 18:46:36 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-07-11 19:02:10 -0400
commit44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (patch)
tree6e16d3ec80c87490dc743f72da086356f2906ace /drivers/net/sundance.c
parentb8a3a5214d7cc115f1ca3a3967b7229d97c46f4a (diff)
PCI: Change all drivers to use pci_device->revision
Instead of all drivers reading pci config space to get the revision ID, they can now use the pci_device->revision member. This exposes some issues where drivers where reading a word or a dword for the revision number, and adding useless error-handling around the read. Some drivers even just read it for no purpose of all. In devices where the revision ID is being copied over and used in what appears to be the equivalent of hotpath, I have left the copy code and the cached copy as not to influence the driver's performance. Compile tested with make all{yes,mod}config on x86_64 and i386. Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com> Acked-by: Dave Jones <davej@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/net/sundance.c')
-rw-r--r--drivers/net/sundance.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c
index e1f912d04043..c9f7b7aa5556 100644
--- a/drivers/net/sundance.c
+++ b/drivers/net/sundance.c
@@ -397,7 +397,6 @@ struct netdev_private {
397 unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ 397 unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */
398 struct pci_dev *pci_dev; 398 struct pci_dev *pci_dev;
399 void __iomem *base; 399 void __iomem *base;
400 unsigned char pci_rev_id;
401}; 400};
402 401
403/* The station address location in the EEPROM. */ 402/* The station address location in the EEPROM. */
@@ -544,8 +543,6 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev,
544 dev->change_mtu = &change_mtu; 543 dev->change_mtu = &change_mtu;
545 pci_set_drvdata(pdev, dev); 544 pci_set_drvdata(pdev, dev);
546 545
547 pci_read_config_byte(pdev, PCI_REVISION_ID, &np->pci_rev_id);
548
549 i = register_netdev(dev); 546 i = register_netdev(dev);
550 if (i) 547 if (i)
551 goto err_out_unmap_rx; 548 goto err_out_unmap_rx;
@@ -828,7 +825,7 @@ static int netdev_open(struct net_device *dev)
828 iowrite8(100, ioaddr + RxDMAPollPeriod); 825 iowrite8(100, ioaddr + RxDMAPollPeriod);
829 iowrite8(127, ioaddr + TxDMAPollPeriod); 826 iowrite8(127, ioaddr + TxDMAPollPeriod);
830 /* Fix DFE-580TX packet drop issue */ 827 /* Fix DFE-580TX packet drop issue */
831 if (np->pci_rev_id >= 0x14) 828 if (np->pci_dev->revision >= 0x14)
832 iowrite8(0x01, ioaddr + DebugCtrl1); 829 iowrite8(0x01, ioaddr + DebugCtrl1);
833 netif_start_queue(dev); 830 netif_start_queue(dev);
834 831
@@ -1194,7 +1191,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance)
1194 hw_frame_id = ioread8(ioaddr + TxFrameId); 1191 hw_frame_id = ioread8(ioaddr + TxFrameId);
1195 } 1192 }
1196 1193
1197 if (np->pci_rev_id >= 0x14) { 1194 if (np->pci_dev->revision >= 0x14) {
1198 spin_lock(&np->lock); 1195 spin_lock(&np->lock);
1199 for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) { 1196 for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) {
1200 int entry = np->dirty_tx % TX_RING_SIZE; 1197 int entry = np->dirty_tx % TX_RING_SIZE;