aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/atm/iphase.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/atm/iphase.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/atm/iphase.c')
-rw-r--r--drivers/atm/iphase.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index bb7ef570514c..a3b605a0ca17 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2290,7 +2290,6 @@ static int __devinit ia_init(struct atm_dev *dev)
2290 unsigned long real_base; 2290 unsigned long real_base;
2291 void __iomem *base; 2291 void __iomem *base;
2292 unsigned short command; 2292 unsigned short command;
2293 unsigned char revision;
2294 int error, i; 2293 int error, i;
2295 2294
2296 /* The device has been identified and registered. Now we read 2295 /* The device has been identified and registered. Now we read
@@ -2305,16 +2304,14 @@ static int __devinit ia_init(struct atm_dev *dev)
2305 real_base = pci_resource_start (iadev->pci, 0); 2304 real_base = pci_resource_start (iadev->pci, 0);
2306 iadev->irq = iadev->pci->irq; 2305 iadev->irq = iadev->pci->irq;
2307 2306
2308 if ((error = pci_read_config_word(iadev->pci, PCI_COMMAND,&command)) 2307 error = pci_read_config_word(iadev->pci, PCI_COMMAND, &command);
2309 || (error = pci_read_config_byte(iadev->pci, 2308 if (error) {
2310 PCI_REVISION_ID,&revision)))
2311 {
2312 printk(KERN_ERR DEV_LABEL "(itf %d): init error 0x%x\n", 2309 printk(KERN_ERR DEV_LABEL "(itf %d): init error 0x%x\n",
2313 dev->number,error); 2310 dev->number,error);
2314 return -EINVAL; 2311 return -EINVAL;
2315 } 2312 }
2316 IF_INIT(printk(DEV_LABEL "(itf %d): rev.%d,realbase=0x%lx,irq=%d\n", 2313 IF_INIT(printk(DEV_LABEL "(itf %d): rev.%d,realbase=0x%lx,irq=%d\n",
2317 dev->number, revision, real_base, iadev->irq);) 2314 dev->number, iadev->pci->revision, real_base, iadev->irq);)
2318 2315
2319 /* find mapping size of board */ 2316 /* find mapping size of board */
2320 2317
@@ -2353,7 +2350,7 @@ static int __devinit ia_init(struct atm_dev *dev)
2353 return error; 2350 return error;
2354 } 2351 }
2355 IF_INIT(printk(DEV_LABEL " (itf %d): rev.%d,base=%p,irq=%d\n", 2352 IF_INIT(printk(DEV_LABEL " (itf %d): rev.%d,base=%p,irq=%d\n",
2356 dev->number, revision, base, iadev->irq);) 2353 dev->number, iadev->pci->revision, base, iadev->irq);)
2357 2354
2358 /* filling the iphase dev structure */ 2355 /* filling the iphase dev structure */
2359 iadev->mem = iadev->pci_map_size /2; 2356 iadev->mem = iadev->pci_map_size /2;