aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/via82cxxx.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/via82cxxx.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/via82cxxx.c')
-rw-r--r--drivers/ide/pci/via82cxxx.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c
index d21dd2e7eeb3..27e92fb9f95e 100644
--- a/drivers/ide/pci/via82cxxx.c
+++ b/drivers/ide/pci/via82cxxx.c
@@ -237,16 +237,14 @@ static int via82cxxx_ide_dma_check (ide_drive_t *drive)
237static struct via_isa_bridge *via_config_find(struct pci_dev **isa) 237static struct via_isa_bridge *via_config_find(struct pci_dev **isa)
238{ 238{
239 struct via_isa_bridge *via_config; 239 struct via_isa_bridge *via_config;
240 u8 t;
241 240
242 for (via_config = via_isa_bridges; via_config->id; via_config++) 241 for (via_config = via_isa_bridges; via_config->id; via_config++)
243 if ((*isa = pci_get_device(PCI_VENDOR_ID_VIA + 242 if ((*isa = pci_get_device(PCI_VENDOR_ID_VIA +
244 !!(via_config->flags & VIA_BAD_ID), 243 !!(via_config->flags & VIA_BAD_ID),
245 via_config->id, NULL))) { 244 via_config->id, NULL))) {
246 245
247 pci_read_config_byte(*isa, PCI_REVISION_ID, &t); 246 if ((*isa)->revision >= via_config->rev_min &&
248 if (t >= via_config->rev_min && 247 (*isa)->revision <= via_config->rev_max)
249 t <= via_config->rev_max)
250 break; 248 break;
251 pci_dev_put(*isa); 249 pci_dev_put(*isa);
252 } 250 }
@@ -404,10 +402,9 @@ static unsigned int __devinit init_chipset_via82cxxx(struct pci_dev *dev, const
404 * Print the boot message. 402 * Print the boot message.
405 */ 403 */
406 404
407 pci_read_config_byte(isa, PCI_REVISION_ID, &t);
408 printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %sDMA%s " 405 printk(KERN_INFO "VP_IDE: VIA %s (rev %02x) IDE %sDMA%s "
409 "controller on pci%s\n", 406 "controller on pci%s\n",
410 via_config->name, t, 407 via_config->name, isa->revision,
411 via_config->udma_mask ? "U" : "MW", 408 via_config->udma_mask ? "U" : "MW",
412 via_dma[via_config->udma_mask ? 409 via_dma[via_config->udma_mask ?
413 (fls(via_config->udma_mask) - 1) : 0], 410 (fls(via_config->udma_mask) - 1) : 0],