aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/amd74xx.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/ide/pci/amd74xx.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/ide/pci/amd74xx.c')
-rw-r--r--drivers/ide/pci/amd74xx.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/ide/pci/amd74xx.c b/drivers/ide/pci/amd74xx.c
index 84ed30cdb324..8d30b99a54d8 100644
--- a/drivers/ide/pci/amd74xx.c
+++ b/drivers/ide/pci/amd74xx.c
@@ -123,8 +123,7 @@ static int amd74xx_get_info(char *buffer, char **addr, off_t offset, int count)
123 amd_print("Driver Version: 2.13"); 123 amd_print("Driver Version: 2.13");
124 amd_print("South Bridge: %s", pci_name(bmide_dev)); 124 amd_print("South Bridge: %s", pci_name(bmide_dev));
125 125
126 pci_read_config_byte(dev, PCI_REVISION_ID, &t); 126 amd_print("Revision: IDE %#x", dev->revision);
127 amd_print("Revision: IDE %#x", t);
128 amd_print("Highest DMA rate: UDMA%s", amd_dma[fls(amd_config->udma_mask) - 1]); 127 amd_print("Highest DMA rate: UDMA%s", amd_dma[fls(amd_config->udma_mask) - 1]);
129 128
130 amd_print("BM-DMA base: %#lx", amd_base); 129 amd_print("BM-DMA base: %#lx", amd_base);
@@ -312,8 +311,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
312 */ 311 */
313 312
314 if (amd_config->flags & AMD_CHECK_SWDMA) { 313 if (amd_config->flags & AMD_CHECK_SWDMA) {
315 pci_read_config_byte(dev, PCI_REVISION_ID, &t); 314 if (dev->revision <= 7)
316 if (t <= 7)
317 amd_config->flags |= AMD_BAD_SWDMA; 315 amd_config->flags |= AMD_BAD_SWDMA;
318 } 316 }
319 317
@@ -383,7 +381,7 @@ static unsigned int __devinit init_chipset_amd74xx(struct pci_dev *dev, const ch
383 381
384 pci_read_config_byte(dev, PCI_REVISION_ID, &t); 382 pci_read_config_byte(dev, PCI_REVISION_ID, &t);
385 printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n", 383 printk(KERN_INFO "%s: %s (rev %02x) UDMA%s controller\n",
386 amd_chipset->name, pci_name(dev), t, 384 amd_chipset->name, pci_name(dev), dev->revision,
387 amd_dma[fls(amd_config->udma_mask) - 1]); 385 amd_dma[fls(amd_config->udma_mask) - 1]);
388 386
389/* 387/*