aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tlan.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/tlan.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/tlan.c')
-rw-r--r--drivers/net/tlan.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c
index 106dc1ef0acb..74eb12107e68 100644
--- a/drivers/net/tlan.c
+++ b/drivers/net/tlan.c
@@ -533,7 +533,6 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
533 533
534 struct net_device *dev; 534 struct net_device *dev;
535 TLanPrivateInfo *priv; 535 TLanPrivateInfo *priv;
536 u8 pci_rev;
537 u16 device_id; 536 u16 device_id;
538 int reg, rc = -ENODEV; 537 int reg, rc = -ENODEV;
539 538
@@ -577,8 +576,6 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
577 goto err_out_free_dev; 576 goto err_out_free_dev;
578 } 577 }
579 578
580 pci_read_config_byte ( pdev, PCI_REVISION_ID, &pci_rev);
581
582 for ( reg= 0; reg <= 5; reg ++ ) { 579 for ( reg= 0; reg <= 5; reg ++ ) {
583 if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) { 580 if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) {
584 pci_io_base = pci_resource_start(pdev, reg); 581 pci_io_base = pci_resource_start(pdev, reg);
@@ -595,7 +592,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev,
595 592
596 dev->base_addr = pci_io_base; 593 dev->base_addr = pci_io_base;
597 dev->irq = pdev->irq; 594 dev->irq = pdev->irq;
598 priv->adapterRev = pci_rev; 595 priv->adapterRev = pdev->revision;
599 pci_set_master(pdev); 596 pci_set_master(pdev);
600 pci_set_drvdata(pdev, dev); 597 pci_set_drvdata(pdev, dev);
601 598