diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2007-06-08 18:46:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:02:10 -0400 |
commit | 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (patch) | |
tree | 6e16d3ec80c87490dc743f72da086356f2906ace /drivers/atm/lanai.c | |
parent | b8a3a5214d7cc115f1ca3a3967b7229d97c46f4a (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/lanai.c')
-rw-r--r-- | drivers/atm/lanai.c | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c index 09f477d4237a..203c70378b15 100644 --- a/drivers/atm/lanai.c +++ b/drivers/atm/lanai.c | |||
@@ -293,7 +293,6 @@ struct lanai_dev { | |||
293 | struct atm_vcc *cbrvcc; | 293 | struct atm_vcc *cbrvcc; |
294 | int number; | 294 | int number; |
295 | int board_rev; | 295 | int board_rev; |
296 | u8 pci_revision; | ||
297 | /* TODO - look at race conditions with maintence of conf1/conf2 */ | 296 | /* TODO - look at race conditions with maintence of conf1/conf2 */ |
298 | /* TODO - transmit locking: should we use _irq not _irqsave? */ | 297 | /* TODO - transmit locking: should we use _irq not _irqsave? */ |
299 | /* TODO - organize above in some rational fashion (see <asm/cache.h>) */ | 298 | /* TODO - organize above in some rational fashion (see <asm/cache.h>) */ |
@@ -1969,14 +1968,6 @@ static int __devinit lanai_pci_start(struct lanai_dev *lanai) | |||
1969 | "(itf %d): No suitable DMA available.\n", lanai->number); | 1968 | "(itf %d): No suitable DMA available.\n", lanai->number); |
1970 | return -EBUSY; | 1969 | return -EBUSY; |
1971 | } | 1970 | } |
1972 | /* Get the pci revision byte */ | ||
1973 | result = pci_read_config_byte(pci, PCI_REVISION_ID, | ||
1974 | &lanai->pci_revision); | ||
1975 | if (result != PCIBIOS_SUCCESSFUL) { | ||
1976 | printk(KERN_ERR DEV_LABEL "(itf %d): can't read " | ||
1977 | "PCI_REVISION_ID: %d\n", lanai->number, result); | ||
1978 | return -EINVAL; | ||
1979 | } | ||
1980 | result = pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &w); | 1971 | result = pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &w); |
1981 | if (result != PCIBIOS_SUCCESSFUL) { | 1972 | if (result != PCIBIOS_SUCCESSFUL) { |
1982 | printk(KERN_ERR DEV_LABEL "(itf %d): can't read " | 1973 | printk(KERN_ERR DEV_LABEL "(itf %d): can't read " |
@@ -2254,7 +2245,7 @@ static int __devinit lanai_dev_open(struct atm_dev *atmdev) | |||
2254 | lanai_timed_poll_start(lanai); | 2245 | lanai_timed_poll_start(lanai); |
2255 | printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d, base=0x%lx, irq=%u " | 2246 | printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d, base=0x%lx, irq=%u " |
2256 | "(%02X-%02X-%02X-%02X-%02X-%02X)\n", lanai->number, | 2247 | "(%02X-%02X-%02X-%02X-%02X-%02X)\n", lanai->number, |
2257 | (int) lanai->pci_revision, (unsigned long) lanai->base, | 2248 | (int) lanai->pci->revision, (unsigned long) lanai->base, |
2258 | lanai->pci->irq, | 2249 | lanai->pci->irq, |
2259 | atmdev->esi[0], atmdev->esi[1], atmdev->esi[2], | 2250 | atmdev->esi[0], atmdev->esi[1], atmdev->esi[2], |
2260 | atmdev->esi[3], atmdev->esi[4], atmdev->esi[5]); | 2251 | atmdev->esi[3], atmdev->esi[4], atmdev->esi[5]); |
@@ -2491,7 +2482,7 @@ static int lanai_proc_read(struct atm_dev *atmdev, loff_t *pos, char *page) | |||
2491 | (unsigned int) lanai->magicno, lanai->num_vci); | 2482 | (unsigned int) lanai->magicno, lanai->num_vci); |
2492 | if (left-- == 0) | 2483 | if (left-- == 0) |
2493 | return sprintf(page, "revision: board=%d, pci_if=%d\n", | 2484 | return sprintf(page, "revision: board=%d, pci_if=%d\n", |
2494 | lanai->board_rev, (int) lanai->pci_revision); | 2485 | lanai->board_rev, (int) lanai->pci->revision); |
2495 | if (left-- == 0) | 2486 | if (left-- == 0) |
2496 | return sprintf(page, "EEPROM ESI: " | 2487 | return sprintf(page, "EEPROM ESI: " |
2497 | "%02X:%02X:%02X:%02X:%02X:%02X\n", | 2488 | "%02X:%02X:%02X:%02X:%02X:%02X\n", |