aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tulip/de4x5.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/tulip/de4x5.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/tulip/de4x5.c')
-rw-r--r--drivers/net/tulip/de4x5.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index 42fca26afc50..09902891a6e6 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -2134,7 +2134,7 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
2134 u_short vendor, status; 2134 u_short vendor, status;
2135 u_int irq = 0, device; 2135 u_int irq = 0, device;
2136 u_long iobase = 0; /* Clear upper 32 bits in Alphas */ 2136 u_long iobase = 0; /* Clear upper 32 bits in Alphas */
2137 int i, j, cfrv; 2137 int i, j;
2138 struct de4x5_private *lp = netdev_priv(dev); 2138 struct de4x5_private *lp = netdev_priv(dev);
2139 struct list_head *walk; 2139 struct list_head *walk;
2140 2140
@@ -2150,7 +2150,6 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
2150 2150
2151 /* Get the chip configuration revision register */ 2151 /* Get the chip configuration revision register */
2152 pb = this_dev->bus->number; 2152 pb = this_dev->bus->number;
2153 pci_read_config_dword(this_dev, PCI_REVISION_ID, &cfrv);
2154 2153
2155 /* Set the device number information */ 2154 /* Set the device number information */
2156 lp->device = PCI_SLOT(this_dev->devfn); 2155 lp->device = PCI_SLOT(this_dev->devfn);
@@ -2158,7 +2157,8 @@ srom_search(struct net_device *dev, struct pci_dev *pdev)
2158 2157
2159 /* Set the chipset information */ 2158 /* Set the chipset information */
2160 if (is_DC2114x) { 2159 if (is_DC2114x) {
2161 device = ((cfrv & CFRV_RN) < DC2114x_BRK ? DC21142 : DC21143); 2160 device = ((this_dev->revision & CFRV_RN) < DC2114x_BRK
2161 ? DC21142 : DC21143);
2162 } 2162 }
2163 lp->chipset = device; 2163 lp->chipset = device;
2164 2164
@@ -2254,7 +2254,7 @@ static int __devinit de4x5_pci_probe (struct pci_dev *pdev,
2254 } 2254 }
2255 2255
2256 /* Get the chip configuration revision register */ 2256 /* Get the chip configuration revision register */
2257 pci_read_config_dword(pdev, PCI_REVISION_ID, &lp->cfrv); 2257 lp->cfrv = pdev->revision;
2258 2258
2259 /* Set the device number information */ 2259 /* Set the device number information */
2260 lp->device = dev_num; 2260 lp->device = dev_num;