diff options
94 files changed, 190 insertions, 459 deletions
diff --git a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c index 0d49d73d1b71..66acd5039918 100644 --- a/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c +++ b/arch/i386/kernel/cpu/cpufreq/cpufreq-nforce2.c | |||
@@ -391,8 +391,6 @@ static struct cpufreq_driver nforce2_driver = { | |||
391 | */ | 391 | */ |
392 | static unsigned int nforce2_detect_chipset(void) | 392 | static unsigned int nforce2_detect_chipset(void) |
393 | { | 393 | { |
394 | u8 revision; | ||
395 | |||
396 | nforce2_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, | 394 | nforce2_chipset_dev = pci_get_subsys(PCI_VENDOR_ID_NVIDIA, |
397 | PCI_DEVICE_ID_NVIDIA_NFORCE2, | 395 | PCI_DEVICE_ID_NVIDIA_NFORCE2, |
398 | PCI_ANY_ID, PCI_ANY_ID, NULL); | 396 | PCI_ANY_ID, PCI_ANY_ID, NULL); |
@@ -400,10 +398,8 @@ static unsigned int nforce2_detect_chipset(void) | |||
400 | if (nforce2_chipset_dev == NULL) | 398 | if (nforce2_chipset_dev == NULL) |
401 | return -ENODEV; | 399 | return -ENODEV; |
402 | 400 | ||
403 | pci_read_config_byte(nforce2_chipset_dev, PCI_REVISION_ID, &revision); | ||
404 | |||
405 | printk(KERN_INFO "cpufreq: Detected nForce2 chipset revision %X\n", | 401 | printk(KERN_INFO "cpufreq: Detected nForce2 chipset revision %X\n", |
406 | revision); | 402 | nforce2_chipset_dev->revision); |
407 | printk(KERN_INFO | 403 | printk(KERN_INFO |
408 | "cpufreq: FSB changing is maybe unstable and can lead to crashes and data loss.\n"); | 404 | "cpufreq: FSB changing is maybe unstable and can lead to crashes and data loss.\n"); |
409 | 405 | ||
diff --git a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c index 6667e9cceb9f..194144539a6f 100644 --- a/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c +++ b/arch/i386/kernel/cpu/cpufreq/gx-suspmod.c | |||
@@ -115,7 +115,6 @@ struct gxfreq_params { | |||
115 | u8 pci_suscfg; | 115 | u8 pci_suscfg; |
116 | u8 pci_pmer1; | 116 | u8 pci_pmer1; |
117 | u8 pci_pmer2; | 117 | u8 pci_pmer2; |
118 | u8 pci_rev; | ||
119 | struct pci_dev *cs55x0; | 118 | struct pci_dev *cs55x0; |
120 | }; | 119 | }; |
121 | 120 | ||
@@ -276,7 +275,7 @@ static void gx_set_cpuspeed(unsigned int khz) | |||
276 | pci_write_config_byte(gx_params->cs55x0, PCI_VIDTC, 100);/* typical 50 to 100ms */ | 275 | pci_write_config_byte(gx_params->cs55x0, PCI_VIDTC, 100);/* typical 50 to 100ms */ |
277 | pci_write_config_byte(gx_params->cs55x0, PCI_PMER1, pmer1); | 276 | pci_write_config_byte(gx_params->cs55x0, PCI_PMER1, pmer1); |
278 | 277 | ||
279 | if (gx_params->pci_rev < 0x10) { /* CS5530(rev 1.2, 1.3) */ | 278 | if (gx_params->cs55x0->revision < 0x10) { /* CS5530(rev 1.2, 1.3) */ |
280 | suscfg = gx_params->pci_suscfg | SUSMOD; | 279 | suscfg = gx_params->pci_suscfg | SUSMOD; |
281 | } else { /* CS5530A,B.. */ | 280 | } else { /* CS5530A,B.. */ |
282 | suscfg = gx_params->pci_suscfg | SUSMOD | PWRSVE; | 281 | suscfg = gx_params->pci_suscfg | SUSMOD | PWRSVE; |
@@ -471,7 +470,6 @@ static int __init cpufreq_gx_init(void) | |||
471 | pci_read_config_byte(params->cs55x0, PCI_PMER2, &(params->pci_pmer2)); | 470 | pci_read_config_byte(params->cs55x0, PCI_PMER2, &(params->pci_pmer2)); |
472 | pci_read_config_byte(params->cs55x0, PCI_MODON, &(params->on_duration)); | 471 | pci_read_config_byte(params->cs55x0, PCI_MODON, &(params->on_duration)); |
473 | pci_read_config_byte(params->cs55x0, PCI_MODOFF, &(params->off_duration)); | 472 | pci_read_config_byte(params->cs55x0, PCI_MODOFF, &(params->off_duration)); |
474 | pci_read_config_byte(params->cs55x0, PCI_REVISION_ID, ¶ms->pci_rev); | ||
475 | 473 | ||
476 | if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) { | 474 | if ((ret = cpufreq_register_driver(&gx_suspmod_driver))) { |
477 | kfree(params); | 475 | kfree(params); |
diff --git a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c index 698f980eb443..a5b2346faf1f 100644 --- a/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c +++ b/arch/i386/kernel/cpu/cpufreq/speedstep-ich.c | |||
@@ -205,7 +205,6 @@ static unsigned int speedstep_detect_chipset (void) | |||
205 | * host brige. Abort on these systems. | 205 | * host brige. Abort on these systems. |
206 | */ | 206 | */ |
207 | static struct pci_dev *hostbridge; | 207 | static struct pci_dev *hostbridge; |
208 | u8 rev = 0; | ||
209 | 208 | ||
210 | hostbridge = pci_get_subsys(PCI_VENDOR_ID_INTEL, | 209 | hostbridge = pci_get_subsys(PCI_VENDOR_ID_INTEL, |
211 | PCI_DEVICE_ID_INTEL_82815_MC, | 210 | PCI_DEVICE_ID_INTEL_82815_MC, |
@@ -216,8 +215,7 @@ static unsigned int speedstep_detect_chipset (void) | |||
216 | if (!hostbridge) | 215 | if (!hostbridge) |
217 | return 2; /* 2-M */ | 216 | return 2; /* 2-M */ |
218 | 217 | ||
219 | pci_read_config_byte(hostbridge, PCI_REVISION_ID, &rev); | 218 | if (hostbridge->revision < 5) { |
220 | if (rev < 5) { | ||
221 | dprintk("hostbridge does not support speedstep\n"); | 219 | dprintk("hostbridge does not support speedstep\n"); |
222 | speedstep_chipset_dev = NULL; | 220 | speedstep_chipset_dev = NULL; |
223 | pci_dev_put(hostbridge); | 221 | pci_dev_put(hostbridge); |
diff --git a/arch/i386/pci/fixup.c b/arch/i386/pci/fixup.c index b95b42950ed4..e7306dbf6c42 100644 --- a/arch/i386/pci/fixup.c +++ b/arch/i386/pci/fixup.c | |||
@@ -118,12 +118,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82371AB_3, pci | |||
118 | static void pci_fixup_via_northbridge_bug(struct pci_dev *d) | 118 | static void pci_fixup_via_northbridge_bug(struct pci_dev *d) |
119 | { | 119 | { |
120 | u8 v; | 120 | u8 v; |
121 | u8 revision; | ||
122 | int where = 0x55; | 121 | int where = 0x55; |
123 | int mask = 0x1f; /* clear bits 5, 6, 7 by default */ | 122 | int mask = 0x1f; /* clear bits 5, 6, 7 by default */ |
124 | 123 | ||
125 | pci_read_config_byte(d, PCI_REVISION_ID, &revision); | ||
126 | |||
127 | if (d->device == PCI_DEVICE_ID_VIA_8367_0) { | 124 | if (d->device == PCI_DEVICE_ID_VIA_8367_0) { |
128 | /* fix pci bus latency issues resulted by NB bios error | 125 | /* fix pci bus latency issues resulted by NB bios error |
129 | it appears on bug free^Wreduced kt266x's bios forces | 126 | it appears on bug free^Wreduced kt266x's bios forces |
@@ -133,8 +130,8 @@ static void pci_fixup_via_northbridge_bug(struct pci_dev *d) | |||
133 | where = 0x95; /* the memory write queue timer register is | 130 | where = 0x95; /* the memory write queue timer register is |
134 | different for the KT266x's: 0x95 not 0x55 */ | 131 | different for the KT266x's: 0x95 not 0x55 */ |
135 | } else if (d->device == PCI_DEVICE_ID_VIA_8363_0 && | 132 | } else if (d->device == PCI_DEVICE_ID_VIA_8363_0 && |
136 | (revision == VIA_8363_KL133_REVISION_ID || | 133 | (d->revision == VIA_8363_KL133_REVISION_ID || |
137 | revision == VIA_8363_KM133_REVISION_ID)) { | 134 | d->revision == VIA_8363_KM133_REVISION_ID)) { |
138 | mask = 0x3f; /* clear only bits 6 and 7; clearing bit 5 | 135 | mask = 0x3f; /* clear only bits 6 and 7; clearing bit 5 |
139 | causes screen corruption on the KL133/KM133 */ | 136 | causes screen corruption on the KL133/KM133 */ |
140 | } | 137 | } |
@@ -142,7 +139,7 @@ static void pci_fixup_via_northbridge_bug(struct pci_dev *d) | |||
142 | pci_read_config_byte(d, where, &v); | 139 | pci_read_config_byte(d, where, &v); |
143 | if (v & ~mask) { | 140 | if (v & ~mask) { |
144 | printk(KERN_WARNING "Disabling VIA memory write queue (PCI ID %04x, rev %02x): [%02x] %02x & %02x -> %02x\n", \ | 141 | printk(KERN_WARNING "Disabling VIA memory write queue (PCI ID %04x, rev %02x): [%02x] %02x & %02x -> %02x\n", \ |
145 | d->device, revision, where, v, mask, v & mask); | 142 | d->device, d->revision, where, v, mask, v & mask); |
146 | v &= mask; | 143 | v &= mask; |
147 | pci_write_config_byte(d, where, v); | 144 | pci_write_config_byte(d, where, v); |
148 | } | 145 | } |
diff --git a/arch/mips/pci/fixup-cobalt.c b/arch/mips/pci/fixup-cobalt.c index 7fc475f7eae5..76b4f0ffb1e5 100644 --- a/arch/mips/pci/fixup-cobalt.c +++ b/arch/mips/pci/fixup-cobalt.c | |||
@@ -58,8 +58,6 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_82C586_1, | |||
58 | 58 | ||
59 | static void qube_raq_galileo_fixup(struct pci_dev *dev) | 59 | static void qube_raq_galileo_fixup(struct pci_dev *dev) |
60 | { | 60 | { |
61 | unsigned short galileo_id; | ||
62 | |||
63 | if (dev->devfn != PCI_DEVFN(0, 0)) | 61 | if (dev->devfn != PCI_DEVFN(0, 0)) |
64 | return; | 62 | return; |
65 | 63 | ||
@@ -84,16 +82,14 @@ static void qube_raq_galileo_fixup(struct pci_dev *dev) | |||
84 | * Therefore we must set the disconnect/retry cycle values to | 82 | * Therefore we must set the disconnect/retry cycle values to |
85 | * something sensible when using the new Galileo. | 83 | * something sensible when using the new Galileo. |
86 | */ | 84 | */ |
87 | pci_read_config_word(dev, PCI_REVISION_ID, &galileo_id); | ||
88 | galileo_id &= 0xff; /* mask off class info */ | ||
89 | 85 | ||
90 | printk(KERN_INFO "Galileo: revision %u\n", galileo_id); | 86 | printk(KERN_INFO "Galileo: revision %u\n", dev->revision); |
91 | 87 | ||
92 | #if 0 | 88 | #if 0 |
93 | if (galileo_id >= 0x10) { | 89 | if (dev->revision >= 0x10) { |
94 | /* New Galileo, assumes PCI stop line to VIA is connected. */ | 90 | /* New Galileo, assumes PCI stop line to VIA is connected. */ |
95 | GT_WRITE(GT_PCI0_TOR_OFS, 0x4020); | 91 | GT_WRITE(GT_PCI0_TOR_OFS, 0x4020); |
96 | } else if (galileo_id == 0x1 || galileo_id == 0x2) | 92 | } else if (dev->revision == 0x1 || dev->revision == 0x2) |
97 | #endif | 93 | #endif |
98 | { | 94 | { |
99 | signed int timeo; | 95 | signed int timeo; |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index f7de02a6f497..e1ca86dfdd66 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -115,7 +115,6 @@ struct acpi_processor_errata errata __read_mostly; | |||
115 | 115 | ||
116 | static int acpi_processor_errata_piix4(struct pci_dev *dev) | 116 | static int acpi_processor_errata_piix4(struct pci_dev *dev) |
117 | { | 117 | { |
118 | u8 rev = 0; | ||
119 | u8 value1 = 0; | 118 | u8 value1 = 0; |
120 | u8 value2 = 0; | 119 | u8 value2 = 0; |
121 | 120 | ||
@@ -127,9 +126,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) | |||
127 | * Note that 'dev' references the PIIX4 ACPI Controller. | 126 | * Note that 'dev' references the PIIX4 ACPI Controller. |
128 | */ | 127 | */ |
129 | 128 | ||
130 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | 129 | switch (dev->revision) { |
131 | |||
132 | switch (rev) { | ||
133 | case 0: | 130 | case 0: |
134 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n")); | 131 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Found PIIX4 A-step\n")); |
135 | break; | 132 | break; |
@@ -147,7 +144,7 @@ static int acpi_processor_errata_piix4(struct pci_dev *dev) | |||
147 | break; | 144 | break; |
148 | } | 145 | } |
149 | 146 | ||
150 | switch (rev) { | 147 | switch (dev->revision) { |
151 | 148 | ||
152 | case 0: /* PIIX4 A-step */ | 149 | case 0: /* PIIX4 A-step */ |
153 | case 1: /* PIIX4 B-step */ | 150 | case 1: /* PIIX4 B-step */ |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index 6a3bfef58e13..2610db75f984 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -928,20 +928,18 @@ static int __devinit piix_check_450nx_errata(struct pci_dev *ata_dev) | |||
928 | { | 928 | { |
929 | struct pci_dev *pdev = NULL; | 929 | struct pci_dev *pdev = NULL; |
930 | u16 cfg; | 930 | u16 cfg; |
931 | u8 rev; | ||
932 | int no_piix_dma = 0; | 931 | int no_piix_dma = 0; |
933 | 932 | ||
934 | while((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev)) != NULL) | 933 | while((pdev = pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev)) != NULL) |
935 | { | 934 | { |
936 | /* Look for 450NX PXB. Check for problem configurations | 935 | /* Look for 450NX PXB. Check for problem configurations |
937 | A PCI quirk checks bit 6 already */ | 936 | A PCI quirk checks bit 6 already */ |
938 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
939 | pci_read_config_word(pdev, 0x41, &cfg); | 937 | pci_read_config_word(pdev, 0x41, &cfg); |
940 | /* Only on the original revision: IDE DMA can hang */ | 938 | /* Only on the original revision: IDE DMA can hang */ |
941 | if (rev == 0x00) | 939 | if (pdev->revision == 0x00) |
942 | no_piix_dma = 1; | 940 | no_piix_dma = 1; |
943 | /* On all revisions below 5 PXB bus lock must be disabled for IDE */ | 941 | /* On all revisions below 5 PXB bus lock must be disabled for IDE */ |
944 | else if (cfg & (1<<14) && rev < 5) | 942 | else if (cfg & (1<<14) && pdev->revision < 5) |
945 | no_piix_dma = 2; | 943 | no_piix_dma = 2; |
946 | } | 944 | } |
947 | if (no_piix_dma) | 945 | if (no_piix_dma) |
diff --git a/drivers/ata/pata_ali.c b/drivers/ata/pata_ali.c index 30c4276ec882..010436795d20 100644 --- a/drivers/ata/pata_ali.c +++ b/drivers/ata/pata_ali.c | |||
@@ -455,23 +455,21 @@ static struct ata_port_operations ali_c5_port_ops = { | |||
455 | 455 | ||
456 | static void ali_init_chipset(struct pci_dev *pdev) | 456 | static void ali_init_chipset(struct pci_dev *pdev) |
457 | { | 457 | { |
458 | u8 rev, tmp; | 458 | u8 tmp; |
459 | struct pci_dev *north, *isa_bridge; | 459 | struct pci_dev *north, *isa_bridge; |
460 | 460 | ||
461 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
462 | |||
463 | /* | 461 | /* |
464 | * The chipset revision selects the driver operations and | 462 | * The chipset revision selects the driver operations and |
465 | * mode data. | 463 | * mode data. |
466 | */ | 464 | */ |
467 | 465 | ||
468 | if (rev >= 0x20 && rev < 0xC2) { | 466 | if (pdev->revision >= 0x20 && pdev->revision < 0xC2) { |
469 | /* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */ | 467 | /* 1543-E/F, 1543C-C, 1543C-D, 1543C-E */ |
470 | pci_read_config_byte(pdev, 0x4B, &tmp); | 468 | pci_read_config_byte(pdev, 0x4B, &tmp); |
471 | /* Clear CD-ROM DMA write bit */ | 469 | /* Clear CD-ROM DMA write bit */ |
472 | tmp &= 0x7F; | 470 | tmp &= 0x7F; |
473 | pci_write_config_byte(pdev, 0x4B, tmp); | 471 | pci_write_config_byte(pdev, 0x4B, tmp); |
474 | } else if (rev >= 0xC2) { | 472 | } else if (pdev->revision >= 0xC2) { |
475 | /* Enable cable detection logic */ | 473 | /* Enable cable detection logic */ |
476 | pci_read_config_byte(pdev, 0x4B, &tmp); | 474 | pci_read_config_byte(pdev, 0x4B, &tmp); |
477 | pci_write_config_byte(pdev, 0x4B, tmp | 0x08); | 475 | pci_write_config_byte(pdev, 0x4B, tmp | 0x08); |
@@ -483,21 +481,21 @@ static void ali_init_chipset(struct pci_dev *pdev) | |||
483 | /* Configure the ALi bridge logic. For non ALi rely on BIOS. | 481 | /* Configure the ALi bridge logic. For non ALi rely on BIOS. |
484 | Set the south bridge enable bit */ | 482 | Set the south bridge enable bit */ |
485 | pci_read_config_byte(isa_bridge, 0x79, &tmp); | 483 | pci_read_config_byte(isa_bridge, 0x79, &tmp); |
486 | if (rev == 0xC2) | 484 | if (pdev->revision == 0xC2) |
487 | pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04); | 485 | pci_write_config_byte(isa_bridge, 0x79, tmp | 0x04); |
488 | else if (rev > 0xC2 && rev < 0xC5) | 486 | else if (pdev->revision > 0xC2 && pdev->revision < 0xC5) |
489 | pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02); | 487 | pci_write_config_byte(isa_bridge, 0x79, tmp | 0x02); |
490 | } | 488 | } |
491 | if (rev >= 0x20) { | 489 | if (pdev->revision >= 0x20) { |
492 | /* | 490 | /* |
493 | * CD_ROM DMA on (0x53 bit 0). Enable this even if we want | 491 | * CD_ROM DMA on (0x53 bit 0). Enable this even if we want |
494 | * to use PIO. 0x53 bit 1 (rev 20 only) - enable FIFO control | 492 | * to use PIO. 0x53 bit 1 (rev 20 only) - enable FIFO control |
495 | * via 0x54/55. | 493 | * via 0x54/55. |
496 | */ | 494 | */ |
497 | pci_read_config_byte(pdev, 0x53, &tmp); | 495 | pci_read_config_byte(pdev, 0x53, &tmp); |
498 | if (rev <= 0x20) | 496 | if (pdev->revision <= 0x20) |
499 | tmp &= ~0x02; | 497 | tmp &= ~0x02; |
500 | if (rev >= 0xc7) | 498 | if (pdev->revision >= 0xc7) |
501 | tmp |= 0x03; | 499 | tmp |= 0x03; |
502 | else | 500 | else |
503 | tmp |= 0x01; /* CD_ROM enable for DMA */ | 501 | tmp |= 0x01; /* CD_ROM enable for DMA */ |
@@ -579,25 +577,23 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
579 | }; | 577 | }; |
580 | 578 | ||
581 | const struct ata_port_info *ppi[] = { NULL, NULL }; | 579 | const struct ata_port_info *ppi[] = { NULL, NULL }; |
582 | u8 rev, tmp; | 580 | u8 tmp; |
583 | struct pci_dev *isa_bridge; | 581 | struct pci_dev *isa_bridge; |
584 | 582 | ||
585 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
586 | |||
587 | /* | 583 | /* |
588 | * The chipset revision selects the driver operations and | 584 | * The chipset revision selects the driver operations and |
589 | * mode data. | 585 | * mode data. |
590 | */ | 586 | */ |
591 | 587 | ||
592 | if (rev < 0x20) { | 588 | if (pdev->revision < 0x20) { |
593 | ppi[0] = &info_early; | 589 | ppi[0] = &info_early; |
594 | } else if (rev < 0xC2) { | 590 | } else if (pdev->revision < 0xC2) { |
595 | ppi[0] = &info_20; | 591 | ppi[0] = &info_20; |
596 | } else if (rev == 0xC2) { | 592 | } else if (pdev->revision == 0xC2) { |
597 | ppi[0] = &info_c2; | 593 | ppi[0] = &info_c2; |
598 | } else if (rev == 0xC3) { | 594 | } else if (pdev->revision == 0xC3) { |
599 | ppi[0] = &info_c3; | 595 | ppi[0] = &info_c3; |
600 | } else if (rev == 0xC4) { | 596 | } else if (pdev->revision == 0xC4) { |
601 | ppi[0] = &info_c4; | 597 | ppi[0] = &info_c4; |
602 | } else | 598 | } else |
603 | ppi[0] = &info_c5; | 599 | ppi[0] = &info_c5; |
@@ -605,7 +601,7 @@ static int ali_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
605 | ali_init_chipset(pdev); | 601 | ali_init_chipset(pdev); |
606 | 602 | ||
607 | isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); | 603 | isa_bridge = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); |
608 | if (isa_bridge && rev >= 0x20 && rev < 0xC2) { | 604 | if (isa_bridge && pdev->revision >= 0x20 && pdev->revision < 0xC2) { |
609 | /* Are we paired with a UDMA capable chip */ | 605 | /* Are we paired with a UDMA capable chip */ |
610 | pci_read_config_byte(isa_bridge, 0x5E, &tmp); | 606 | pci_read_config_byte(isa_bridge, 0x5E, &tmp); |
611 | if ((tmp & 0x1E) == 0x12) | 607 | if ((tmp & 0x1E) == 0x12) |
diff --git a/drivers/ata/pata_amd.c b/drivers/ata/pata_amd.c index b9c44c575ce3..b09facad63e1 100644 --- a/drivers/ata/pata_amd.c +++ b/drivers/ata/pata_amd.c | |||
@@ -623,17 +623,15 @@ static int amd_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
623 | const struct ata_port_info *ppi[] = { NULL, NULL }; | 623 | const struct ata_port_info *ppi[] = { NULL, NULL }; |
624 | static int printed_version; | 624 | static int printed_version; |
625 | int type = id->driver_data; | 625 | int type = id->driver_data; |
626 | u8 rev; | ||
627 | u8 fifo; | 626 | u8 fifo; |
628 | 627 | ||
629 | if (!printed_version++) | 628 | if (!printed_version++) |
630 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); | 629 | dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n"); |
631 | 630 | ||
632 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
633 | pci_read_config_byte(pdev, 0x41, &fifo); | 631 | pci_read_config_byte(pdev, 0x41, &fifo); |
634 | 632 | ||
635 | /* Check for AMD7409 without swdma errata and if found adjust type */ | 633 | /* Check for AMD7409 without swdma errata and if found adjust type */ |
636 | if (type == 1 && rev > 0x7) | 634 | if (type == 1 && pdev->revision > 0x7) |
637 | type = 2; | 635 | type = 2; |
638 | 636 | ||
639 | /* Check for AMD7411 */ | 637 | /* Check for AMD7411 */ |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index b67bbf6516ba..430673be1df7 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -587,8 +587,7 @@ static int it821x_port_start(struct ata_port *ap) | |||
587 | itdev->want[1][1] = ATA_ANY; | 587 | itdev->want[1][1] = ATA_ANY; |
588 | itdev->last_device = -1; | 588 | itdev->last_device = -1; |
589 | 589 | ||
590 | pci_read_config_byte(pdev, PCI_REVISION_ID, &conf); | 590 | if (pdev->revision == 0x11) { |
591 | if (conf == 0x10) { | ||
592 | itdev->timing10 = 1; | 591 | itdev->timing10 = 1; |
593 | /* Need to disable ATAPI DMA for this case */ | 592 | /* Need to disable ATAPI DMA for this case */ |
594 | if (!itdev->smart) | 593 | if (!itdev->smart) |
diff --git a/drivers/ata/pata_serverworks.c b/drivers/ata/pata_serverworks.c index 0231aba51ca4..89691541fe59 100644 --- a/drivers/ata/pata_serverworks.c +++ b/drivers/ata/pata_serverworks.c | |||
@@ -410,11 +410,8 @@ static int serverworks_fixup_osb4(struct pci_dev *pdev) | |||
410 | 410 | ||
411 | static int serverworks_fixup_csb(struct pci_dev *pdev) | 411 | static int serverworks_fixup_csb(struct pci_dev *pdev) |
412 | { | 412 | { |
413 | u8 rev; | ||
414 | u8 btr; | 413 | u8 btr; |
415 | 414 | ||
416 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
417 | |||
418 | /* Third Channel Test */ | 415 | /* Third Channel Test */ |
419 | if (!(PCI_FUNC(pdev->devfn) & 1)) { | 416 | if (!(PCI_FUNC(pdev->devfn) & 1)) { |
420 | struct pci_dev * findev = NULL; | 417 | struct pci_dev * findev = NULL; |
@@ -456,7 +453,7 @@ static int serverworks_fixup_csb(struct pci_dev *pdev) | |||
456 | if (!(PCI_FUNC(pdev->devfn) & 1)) | 453 | if (!(PCI_FUNC(pdev->devfn) & 1)) |
457 | btr |= 0x2; | 454 | btr |= 0x2; |
458 | else | 455 | else |
459 | btr |= (rev >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; | 456 | btr |= (pdev->revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; |
460 | pci_write_config_byte(pdev, 0x5A, btr); | 457 | pci_write_config_byte(pdev, 0x5A, btr); |
461 | 458 | ||
462 | return btr; | 459 | return btr; |
diff --git a/drivers/ata/pata_sis.c b/drivers/ata/pata_sis.c index 2b4508206a6c..74a021124f3c 100644 --- a/drivers/ata/pata_sis.c +++ b/drivers/ata/pata_sis.c | |||
@@ -928,9 +928,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
928 | if (host != NULL) { | 928 | if (host != NULL) { |
929 | chipset = sets; /* Match found */ | 929 | chipset = sets; /* Match found */ |
930 | if (sets->device == 0x630) { /* SIS630 */ | 930 | if (sets->device == 0x630) { /* SIS630 */ |
931 | u8 host_rev; | 931 | if (host->revision >= 0x30) /* 630 ET */ |
932 | pci_read_config_byte(host, PCI_REVISION_ID, &host_rev); | ||
933 | if (host_rev >= 0x30) /* 630 ET */ | ||
934 | chipset = &sis100_early; | 932 | chipset = &sis100_early; |
935 | } | 933 | } |
936 | break; | 934 | break; |
@@ -974,7 +972,6 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
974 | u16 trueid; | 972 | u16 trueid; |
975 | u8 prefctl; | 973 | u8 prefctl; |
976 | u8 idecfg; | 974 | u8 idecfg; |
977 | u8 sbrev; | ||
978 | 975 | ||
979 | /* Try the second unmasking technique */ | 976 | /* Try the second unmasking technique */ |
980 | pci_read_config_byte(pdev, 0x4a, &idecfg); | 977 | pci_read_config_byte(pdev, 0x4a, &idecfg); |
@@ -987,11 +984,10 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
987 | lpc_bridge = pci_get_slot(pdev->bus, 0x10); /* Bus 0 Dev 2 Fn 0 */ | 984 | lpc_bridge = pci_get_slot(pdev->bus, 0x10); /* Bus 0 Dev 2 Fn 0 */ |
988 | if (lpc_bridge == NULL) | 985 | if (lpc_bridge == NULL) |
989 | break; | 986 | break; |
990 | pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev); | ||
991 | pci_read_config_byte(pdev, 0x49, &prefctl); | 987 | pci_read_config_byte(pdev, 0x49, &prefctl); |
992 | pci_dev_put(lpc_bridge); | 988 | pci_dev_put(lpc_bridge); |
993 | 989 | ||
994 | if (sbrev == 0x10 && (prefctl & 0x80)) { | 990 | if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) { |
995 | chipset = &sis133_early; | 991 | chipset = &sis133_early; |
996 | break; | 992 | break; |
997 | } | 993 | } |
diff --git a/drivers/ata/pata_sl82c105.c b/drivers/ata/pata_sl82c105.c index bde734189623..8c2813aa6cdb 100644 --- a/drivers/ata/pata_sl82c105.c +++ b/drivers/ata/pata_sl82c105.c | |||
@@ -270,7 +270,6 @@ static struct ata_port_operations sl82c105_port_ops = { | |||
270 | static int sl82c105_bridge_revision(struct pci_dev *pdev) | 270 | static int sl82c105_bridge_revision(struct pci_dev *pdev) |
271 | { | 271 | { |
272 | struct pci_dev *bridge; | 272 | struct pci_dev *bridge; |
273 | u8 rev; | ||
274 | 273 | ||
275 | /* | 274 | /* |
276 | * The bridge should be part of the same device, but function 0. | 275 | * The bridge should be part of the same device, but function 0. |
@@ -292,10 +291,8 @@ static int sl82c105_bridge_revision(struct pci_dev *pdev) | |||
292 | /* | 291 | /* |
293 | * We need to find function 0's revision, not function 1 | 292 | * We need to find function 0's revision, not function 1 |
294 | */ | 293 | */ |
295 | pci_read_config_byte(bridge, PCI_REVISION_ID, &rev); | ||
296 | |||
297 | pci_dev_put(bridge); | 294 | pci_dev_put(bridge); |
298 | return rev; | 295 | return bridge->revision; |
299 | } | 296 | } |
300 | 297 | ||
301 | 298 | ||
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index f0cadbe6aa11..f645fe22cd1e 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -506,7 +506,6 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
506 | struct pci_dev *isa = NULL; | 506 | struct pci_dev *isa = NULL; |
507 | const struct via_isa_bridge *config; | 507 | const struct via_isa_bridge *config; |
508 | static int printed_version; | 508 | static int printed_version; |
509 | u8 t; | ||
510 | u8 enable; | 509 | u8 enable; |
511 | u32 timing; | 510 | u32 timing; |
512 | 511 | ||
@@ -520,9 +519,8 @@ static int via_init_one(struct pci_dev *pdev, const struct pci_device_id *id) | |||
520 | !!(config->flags & VIA_BAD_ID), | 519 | !!(config->flags & VIA_BAD_ID), |
521 | config->id, NULL))) { | 520 | config->id, NULL))) { |
522 | 521 | ||
523 | pci_read_config_byte(isa, PCI_REVISION_ID, &t); | 522 | if (isa->revision >= config->rev_min && |
524 | if (t >= config->rev_min && | 523 | isa->revision <= config->rev_max) |
525 | t <= config->rev_max) | ||
526 | break; | 524 | break; |
527 | pci_dev_put(isa); | 525 | pci_dev_put(isa); |
528 | } | 526 | } |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index 3873b29c80d6..6dcfc628aab1 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -1573,12 +1573,9 @@ static void mv5_scr_write(struct ata_port *ap, unsigned int sc_reg_in, u32 val) | |||
1573 | 1573 | ||
1574 | static void mv5_reset_bus(struct pci_dev *pdev, void __iomem *mmio) | 1574 | static void mv5_reset_bus(struct pci_dev *pdev, void __iomem *mmio) |
1575 | { | 1575 | { |
1576 | u8 rev_id; | ||
1577 | int early_5080; | 1576 | int early_5080; |
1578 | 1577 | ||
1579 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | 1578 | early_5080 = (pdev->device == 0x5080) && (pdev->revision == 0); |
1580 | |||
1581 | early_5080 = (pdev->device == 0x5080) && (rev_id == 0); | ||
1582 | 1579 | ||
1583 | if (!early_5080) { | 1580 | if (!early_5080) { |
1584 | u32 tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL); | 1581 | u32 tmp = readl(mmio + MV_PCI_EXP_ROM_BAR_CTL); |
@@ -2139,17 +2136,14 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) | |||
2139 | { | 2136 | { |
2140 | struct pci_dev *pdev = to_pci_dev(host->dev); | 2137 | struct pci_dev *pdev = to_pci_dev(host->dev); |
2141 | struct mv_host_priv *hpriv = host->private_data; | 2138 | struct mv_host_priv *hpriv = host->private_data; |
2142 | u8 rev_id; | ||
2143 | u32 hp_flags = hpriv->hp_flags; | 2139 | u32 hp_flags = hpriv->hp_flags; |
2144 | 2140 | ||
2145 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | ||
2146 | |||
2147 | switch(board_idx) { | 2141 | switch(board_idx) { |
2148 | case chip_5080: | 2142 | case chip_5080: |
2149 | hpriv->ops = &mv5xxx_ops; | 2143 | hpriv->ops = &mv5xxx_ops; |
2150 | hp_flags |= MV_HP_50XX; | 2144 | hp_flags |= MV_HP_50XX; |
2151 | 2145 | ||
2152 | switch (rev_id) { | 2146 | switch (pdev->revision) { |
2153 | case 0x1: | 2147 | case 0x1: |
2154 | hp_flags |= MV_HP_ERRATA_50XXB0; | 2148 | hp_flags |= MV_HP_ERRATA_50XXB0; |
2155 | break; | 2149 | break; |
@@ -2169,7 +2163,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) | |||
2169 | hpriv->ops = &mv5xxx_ops; | 2163 | hpriv->ops = &mv5xxx_ops; |
2170 | hp_flags |= MV_HP_50XX; | 2164 | hp_flags |= MV_HP_50XX; |
2171 | 2165 | ||
2172 | switch (rev_id) { | 2166 | switch (pdev->revision) { |
2173 | case 0x0: | 2167 | case 0x0: |
2174 | hp_flags |= MV_HP_ERRATA_50XXB0; | 2168 | hp_flags |= MV_HP_ERRATA_50XXB0; |
2175 | break; | 2169 | break; |
@@ -2188,7 +2182,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) | |||
2188 | case chip_608x: | 2182 | case chip_608x: |
2189 | hpriv->ops = &mv6xxx_ops; | 2183 | hpriv->ops = &mv6xxx_ops; |
2190 | 2184 | ||
2191 | switch (rev_id) { | 2185 | switch (pdev->revision) { |
2192 | case 0x7: | 2186 | case 0x7: |
2193 | hp_flags |= MV_HP_ERRATA_60X1B2; | 2187 | hp_flags |= MV_HP_ERRATA_60X1B2; |
2194 | break; | 2188 | break; |
@@ -2209,7 +2203,7 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) | |||
2209 | 2203 | ||
2210 | hp_flags |= MV_HP_GEN_IIE; | 2204 | hp_flags |= MV_HP_GEN_IIE; |
2211 | 2205 | ||
2212 | switch (rev_id) { | 2206 | switch (pdev->revision) { |
2213 | case 0x0: | 2207 | case 0x0: |
2214 | hp_flags |= MV_HP_ERRATA_XX42A0; | 2208 | hp_flags |= MV_HP_ERRATA_XX42A0; |
2215 | break; | 2209 | break; |
@@ -2337,14 +2331,12 @@ static void mv_print_info(struct ata_host *host) | |||
2337 | { | 2331 | { |
2338 | struct pci_dev *pdev = to_pci_dev(host->dev); | 2332 | struct pci_dev *pdev = to_pci_dev(host->dev); |
2339 | struct mv_host_priv *hpriv = host->private_data; | 2333 | struct mv_host_priv *hpriv = host->private_data; |
2340 | u8 rev_id, scc; | 2334 | u8 scc; |
2341 | const char *scc_s, *gen; | 2335 | const char *scc_s, *gen; |
2342 | 2336 | ||
2343 | /* Use this to determine the HW stepping of the chip so we know | 2337 | /* Use this to determine the HW stepping of the chip so we know |
2344 | * what errata to workaround | 2338 | * what errata to workaround |
2345 | */ | 2339 | */ |
2346 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | ||
2347 | |||
2348 | pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &scc); | 2340 | pci_read_config_byte(pdev, PCI_CLASS_DEVICE, &scc); |
2349 | if (scc == 0) | 2341 | if (scc == 0) |
2350 | scc_s = "SCSI"; | 2342 | scc_s = "SCSI"; |
diff --git a/drivers/atm/eni.c b/drivers/atm/eni.c index 0d3a38b1cb0b..77637e780d41 100644 --- a/drivers/atm/eni.c +++ b/drivers/atm/eni.c | |||
@@ -1704,7 +1704,6 @@ static int __devinit eni_do_init(struct atm_dev *dev) | |||
1704 | struct pci_dev *pci_dev; | 1704 | struct pci_dev *pci_dev; |
1705 | unsigned long real_base; | 1705 | unsigned long real_base; |
1706 | void __iomem *base; | 1706 | void __iomem *base; |
1707 | unsigned char revision; | ||
1708 | int error,i,last; | 1707 | int error,i,last; |
1709 | 1708 | ||
1710 | DPRINTK(">eni_init\n"); | 1709 | DPRINTK(">eni_init\n"); |
@@ -1715,12 +1714,6 @@ static int __devinit eni_do_init(struct atm_dev *dev) | |||
1715 | pci_dev = eni_dev->pci_dev; | 1714 | pci_dev = eni_dev->pci_dev; |
1716 | real_base = pci_resource_start(pci_dev, 0); | 1715 | real_base = pci_resource_start(pci_dev, 0); |
1717 | eni_dev->irq = pci_dev->irq; | 1716 | eni_dev->irq = pci_dev->irq; |
1718 | error = pci_read_config_byte(pci_dev,PCI_REVISION_ID,&revision); | ||
1719 | if (error) { | ||
1720 | printk(KERN_ERR DEV_LABEL "(itf %d): init error 0x%02x\n", | ||
1721 | dev->number,error); | ||
1722 | return -EINVAL; | ||
1723 | } | ||
1724 | if ((error = pci_write_config_word(pci_dev,PCI_COMMAND, | 1717 | if ((error = pci_write_config_word(pci_dev,PCI_COMMAND, |
1725 | PCI_COMMAND_MEMORY | | 1718 | PCI_COMMAND_MEMORY | |
1726 | (eni_dev->asic ? PCI_COMMAND_PARITY | PCI_COMMAND_SERR : 0)))) { | 1719 | (eni_dev->asic ? PCI_COMMAND_PARITY | PCI_COMMAND_SERR : 0)))) { |
@@ -1729,7 +1722,7 @@ static int __devinit eni_do_init(struct atm_dev *dev) | |||
1729 | return -EIO; | 1722 | return -EIO; |
1730 | } | 1723 | } |
1731 | printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d,base=0x%lx,irq=%d,", | 1724 | printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d,base=0x%lx,irq=%d,", |
1732 | dev->number,revision,real_base,eni_dev->irq); | 1725 | dev->number,pci_dev->revision,real_base,eni_dev->irq); |
1733 | if (!(base = ioremap_nocache(real_base,MAP_MAX_SIZE))) { | 1726 | if (!(base = ioremap_nocache(real_base,MAP_MAX_SIZE))) { |
1734 | printk("\n"); | 1727 | printk("\n"); |
1735 | printk(KERN_ERR DEV_LABEL "(itf %d): can't set up page " | 1728 | printk(KERN_ERR DEV_LABEL "(itf %d): can't set up page " |
diff --git a/drivers/atm/idt77252.c b/drivers/atm/idt77252.c index 3800bc0cb2ef..8f995ce8d73b 100644 --- a/drivers/atm/idt77252.c +++ b/drivers/atm/idt77252.c | |||
@@ -3679,7 +3679,6 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) | |||
3679 | unsigned long membase, srambase; | 3679 | unsigned long membase, srambase; |
3680 | struct idt77252_dev *card; | 3680 | struct idt77252_dev *card; |
3681 | struct atm_dev *dev; | 3681 | struct atm_dev *dev; |
3682 | ushort revision = 0; | ||
3683 | int i, err; | 3682 | int i, err; |
3684 | 3683 | ||
3685 | 3684 | ||
@@ -3688,19 +3687,13 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) | |||
3688 | return err; | 3687 | return err; |
3689 | } | 3688 | } |
3690 | 3689 | ||
3691 | if (pci_read_config_word(pcidev, PCI_REVISION_ID, &revision)) { | ||
3692 | printk("idt77252-%d: can't read PCI_REVISION_ID\n", index); | ||
3693 | err = -ENODEV; | ||
3694 | goto err_out_disable_pdev; | ||
3695 | } | ||
3696 | |||
3697 | card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL); | 3690 | card = kzalloc(sizeof(struct idt77252_dev), GFP_KERNEL); |
3698 | if (!card) { | 3691 | if (!card) { |
3699 | printk("idt77252-%d: can't allocate private data\n", index); | 3692 | printk("idt77252-%d: can't allocate private data\n", index); |
3700 | err = -ENOMEM; | 3693 | err = -ENOMEM; |
3701 | goto err_out_disable_pdev; | 3694 | goto err_out_disable_pdev; |
3702 | } | 3695 | } |
3703 | card->revision = revision; | 3696 | card->revision = pcidev->revision; |
3704 | card->index = index; | 3697 | card->index = index; |
3705 | card->pcidev = pcidev; | 3698 | card->pcidev = pcidev; |
3706 | sprintf(card->name, "idt77252-%d", card->index); | 3699 | sprintf(card->name, "idt77252-%d", card->index); |
@@ -3762,8 +3755,8 @@ idt77252_init_one(struct pci_dev *pcidev, const struct pci_device_id *id) | |||
3762 | } | 3755 | } |
3763 | 3756 | ||
3764 | printk("%s: ABR SAR (Rev %c): MEM %08lx SRAM %08lx [%u KB]\n", | 3757 | printk("%s: ABR SAR (Rev %c): MEM %08lx SRAM %08lx [%u KB]\n", |
3765 | card->name, ((revision > 1) && (revision < 25)) ? | 3758 | card->name, ((card->revision > 1) && (card->revision < 25)) ? |
3766 | 'A' + revision - 1 : '?', membase, srambase, | 3759 | 'A' + card->revision - 1 : '?', membase, srambase, |
3767 | card->sramsize / 1024); | 3760 | card->sramsize / 1024); |
3768 | 3761 | ||
3769 | if (init_card(dev)) { | 3762 | if (init_card(dev)) { |
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; |
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", |
diff --git a/drivers/atm/zatm.c b/drivers/atm/zatm.c index 2ad2527cf5b3..020a87a476c8 100644 --- a/drivers/atm/zatm.c +++ b/drivers/atm/zatm.c | |||
@@ -1182,7 +1182,6 @@ static int __devinit zatm_init(struct atm_dev *dev) | |||
1182 | struct zatm_dev *zatm_dev; | 1182 | struct zatm_dev *zatm_dev; |
1183 | struct pci_dev *pci_dev; | 1183 | struct pci_dev *pci_dev; |
1184 | unsigned short command; | 1184 | unsigned short command; |
1185 | unsigned char revision; | ||
1186 | int error,i,last; | 1185 | int error,i,last; |
1187 | unsigned long t0,t1,t2; | 1186 | unsigned long t0,t1,t2; |
1188 | 1187 | ||
@@ -1192,8 +1191,7 @@ static int __devinit zatm_init(struct atm_dev *dev) | |||
1192 | pci_dev = zatm_dev->pci_dev; | 1191 | pci_dev = zatm_dev->pci_dev; |
1193 | zatm_dev->base = pci_resource_start(pci_dev, 0); | 1192 | zatm_dev->base = pci_resource_start(pci_dev, 0); |
1194 | zatm_dev->irq = pci_dev->irq; | 1193 | zatm_dev->irq = pci_dev->irq; |
1195 | if ((error = pci_read_config_word(pci_dev,PCI_COMMAND,&command)) || | 1194 | if ((error = pci_read_config_word(pci_dev,PCI_COMMAND,&command))) { |
1196 | (error = pci_read_config_byte(pci_dev,PCI_REVISION_ID,&revision))) { | ||
1197 | printk(KERN_ERR DEV_LABEL "(itf %d): init error 0x%02x\n", | 1195 | printk(KERN_ERR DEV_LABEL "(itf %d): init error 0x%02x\n", |
1198 | dev->number,error); | 1196 | dev->number,error); |
1199 | return -EINVAL; | 1197 | return -EINVAL; |
@@ -1206,7 +1204,7 @@ static int __devinit zatm_init(struct atm_dev *dev) | |||
1206 | } | 1204 | } |
1207 | eprom_get_esi(dev); | 1205 | eprom_get_esi(dev); |
1208 | printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d,base=0x%x,irq=%d,", | 1206 | printk(KERN_NOTICE DEV_LABEL "(itf %d): rev.%d,base=0x%x,irq=%d,", |
1209 | dev->number,revision,zatm_dev->base,zatm_dev->irq); | 1207 | dev->number,pci_dev->revision,zatm_dev->base,zatm_dev->irq); |
1210 | /* reset uPD98401 */ | 1208 | /* reset uPD98401 */ |
1211 | zout(0,SWR); | 1209 | zout(0,SWR); |
1212 | while (!(zin(GSR) & uPD98401_INT_IND)); | 1210 | while (!(zin(GSR) & uPD98401_INT_IND)); |
diff --git a/drivers/char/agp/amd-k7-agp.c b/drivers/char/agp/amd-k7-agp.c index e6c534e62846..df0ddf14b85c 100644 --- a/drivers/char/agp/amd-k7-agp.c +++ b/drivers/char/agp/amd-k7-agp.c | |||
@@ -462,9 +462,7 @@ static int __devinit agp_amdk7_probe(struct pci_dev *pdev, | |||
462 | * erratum 46: Setup violation on AGP SBA pins - Disable side band addressing. | 462 | * erratum 46: Setup violation on AGP SBA pins - Disable side band addressing. |
463 | * With this lot disabled, we should prevent lockups. */ | 463 | * With this lot disabled, we should prevent lockups. */ |
464 | if (agp_bridge->dev->device == PCI_DEVICE_ID_AMD_FE_GATE_700E) { | 464 | if (agp_bridge->dev->device == PCI_DEVICE_ID_AMD_FE_GATE_700E) { |
465 | u8 revision=0; | 465 | if (pdev->revision == 0x10 || pdev->revision == 0x11) { |
466 | pci_read_config_byte(pdev, PCI_REVISION_ID, &revision); | ||
467 | if (revision == 0x10 || revision == 0x11) { | ||
468 | agp_bridge->flags = AGP_ERRATA_FASTWRITES; | 466 | agp_bridge->flags = AGP_ERRATA_FASTWRITES; |
469 | agp_bridge->flags |= AGP_ERRATA_SBA; | 467 | agp_bridge->flags |= AGP_ERRATA_SBA; |
470 | agp_bridge->flags |= AGP_ERRATA_1X; | 468 | agp_bridge->flags |= AGP_ERRATA_1X; |
diff --git a/drivers/char/agp/amd64-agp.c b/drivers/char/agp/amd64-agp.c index 801abdd29066..d95662e96326 100644 --- a/drivers/char/agp/amd64-agp.c +++ b/drivers/char/agp/amd64-agp.c | |||
@@ -367,10 +367,8 @@ static __devinit int cache_nbs (struct pci_dev *pdev, u32 cap_ptr) | |||
367 | static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data *bridge) | 367 | static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data *bridge) |
368 | { | 368 | { |
369 | char *revstring; | 369 | char *revstring; |
370 | u8 rev_id; | ||
371 | 370 | ||
372 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | 371 | switch (pdev->revision) { |
373 | switch (rev_id) { | ||
374 | case 0x01: revstring="A0"; break; | 372 | case 0x01: revstring="A0"; break; |
375 | case 0x02: revstring="A1"; break; | 373 | case 0x02: revstring="A1"; break; |
376 | case 0x11: revstring="B0"; break; | 374 | case 0x11: revstring="B0"; break; |
@@ -386,7 +384,7 @@ static void __devinit amd8151_init(struct pci_dev *pdev, struct agp_bridge_data | |||
386 | * Work around errata. | 384 | * Work around errata. |
387 | * Chips before B2 stepping incorrectly reporting v3.5 | 385 | * Chips before B2 stepping incorrectly reporting v3.5 |
388 | */ | 386 | */ |
389 | if (rev_id < 0x13) { | 387 | if (pdev->revision < 0x13) { |
390 | printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n"); | 388 | printk (KERN_INFO PFX "Correcting AGP revision (reports 3.5, is really 3.0)\n"); |
391 | bridge->major_version = 3; | 389 | bridge->major_version = 3; |
392 | bridge->minor_version = 0; | 390 | bridge->minor_version = 0; |
diff --git a/drivers/clocksource/acpi_pm.c b/drivers/clocksource/acpi_pm.c index 5cfcff532545..e783dbf0f162 100644 --- a/drivers/clocksource/acpi_pm.c +++ b/drivers/clocksource/acpi_pm.c | |||
@@ -105,14 +105,11 @@ static inline void acpi_pm_need_workaround(void) | |||
105 | */ | 105 | */ |
106 | static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev) | 106 | static void __devinit acpi_pm_check_blacklist(struct pci_dev *dev) |
107 | { | 107 | { |
108 | u8 rev; | ||
109 | |||
110 | if (acpi_pm_good) | 108 | if (acpi_pm_good) |
111 | return; | 109 | return; |
112 | 110 | ||
113 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | ||
114 | /* the bug has been fixed in PIIX4M */ | 111 | /* the bug has been fixed in PIIX4M */ |
115 | if (rev < 3) { | 112 | if (dev->revision < 3) { |
116 | printk(KERN_WARNING "* Found PM-Timer Bug on the chipset." | 113 | printk(KERN_WARNING "* Found PM-Timer Bug on the chipset." |
117 | " Due to workarounds for a bug,\n" | 114 | " Due to workarounds for a bug,\n" |
118 | "* this clock source is slow. Consider trying" | 115 | "* this clock source is slow. Consider trying" |
diff --git a/drivers/i2c/busses/i2c-viapro.c b/drivers/i2c/busses/i2c-viapro.c index 7a2bc06304fc..1d76b9e5207a 100644 --- a/drivers/i2c/busses/i2c-viapro.c +++ b/drivers/i2c/busses/i2c-viapro.c | |||
@@ -397,8 +397,7 @@ found: | |||
397 | case PCI_DEVICE_ID_VIA_82C686_4: | 397 | case PCI_DEVICE_ID_VIA_82C686_4: |
398 | /* The VT82C686B (rev 0x40) does support I2C block | 398 | /* The VT82C686B (rev 0x40) does support I2C block |
399 | transactions, but the VT82C686A (rev 0x30) doesn't */ | 399 | transactions, but the VT82C686A (rev 0x30) doesn't */ |
400 | if (!pci_read_config_byte(pdev, PCI_REVISION_ID, &temp) | 400 | if (pdev->revision >= 0x40) |
401 | && temp >= 0x40) | ||
402 | vt596_features |= FEATURE_I2CBLOCK; | 401 | vt596_features |= FEATURE_I2CBLOCK; |
403 | break; | 402 | break; |
404 | } | 403 | } |
diff --git a/drivers/ide/pci/alim15x3.c b/drivers/ide/pci/alim15x3.c index 8a6b27b3bcc3..ba0fb92b0417 100644 --- a/drivers/ide/pci/alim15x3.c +++ b/drivers/ide/pci/alim15x3.c | |||
@@ -508,7 +508,7 @@ static unsigned int __devinit init_chipset_ali15x3 (struct pci_dev *dev, const c | |||
508 | u8 tmpbyte; | 508 | u8 tmpbyte; |
509 | struct pci_dev *north = pci_get_slot(dev->bus, PCI_DEVFN(0,0)); | 509 | struct pci_dev *north = pci_get_slot(dev->bus, PCI_DEVFN(0,0)); |
510 | 510 | ||
511 | pci_read_config_byte(dev, PCI_REVISION_ID, &m5229_revision); | 511 | m5229_revision = dev->revision; |
512 | 512 | ||
513 | isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); | 513 | isa_dev = pci_get_device(PCI_VENDOR_ID_AL, PCI_DEVICE_ID_AL_M1533, NULL); |
514 | 514 | ||
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 | /* |
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c index 8631b6c8aa15..1e89dd6e5bbf 100644 --- a/drivers/ide/pci/cmd64x.c +++ b/drivers/ide/pci/cmd64x.c | |||
@@ -88,7 +88,6 @@ static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index) | |||
88 | u8 reg72 = 0, reg73 = 0; /* primary */ | 88 | u8 reg72 = 0, reg73 = 0; /* primary */ |
89 | u8 reg7a = 0, reg7b = 0; /* secondary */ | 89 | u8 reg7a = 0, reg7b = 0; /* secondary */ |
90 | u8 reg50 = 1, reg51 = 1, reg57 = 0, reg71 = 0; /* extra */ | 90 | u8 reg50 = 1, reg51 = 1, reg57 = 0, reg71 = 0; /* extra */ |
91 | u8 rev = 0; | ||
92 | 91 | ||
93 | p += sprintf(p, "\nController: %d\n", index); | 92 | p += sprintf(p, "\nController: %d\n", index); |
94 | p += sprintf(p, "PCI-%x Chipset.\n", dev->device); | 93 | p += sprintf(p, "PCI-%x Chipset.\n", dev->device); |
@@ -103,9 +102,8 @@ static char * print_cmd64x_get_info (char *buf, struct pci_dev *dev, int index) | |||
103 | (void) pci_read_config_byte(dev, UDIDETCR1, ®7b); | 102 | (void) pci_read_config_byte(dev, UDIDETCR1, ®7b); |
104 | 103 | ||
105 | /* PCI0643/6 originally didn't have the primary channel enable bit */ | 104 | /* PCI0643/6 originally didn't have the primary channel enable bit */ |
106 | (void) pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | ||
107 | if ((dev->device == PCI_DEVICE_ID_CMD_643) || | 105 | if ((dev->device == PCI_DEVICE_ID_CMD_643) || |
108 | (dev->device == PCI_DEVICE_ID_CMD_646 && rev < 3)) | 106 | (dev->device == PCI_DEVICE_ID_CMD_646 && dev->revision < 3)) |
109 | reg51 |= CNTRL_ENA_1ST; | 107 | reg51 |= CNTRL_ENA_1ST; |
110 | 108 | ||
111 | p += sprintf(p, "---------------- Primary Channel " | 109 | p += sprintf(p, "---------------- Primary Channel " |
@@ -604,14 +602,11 @@ static int __devinit init_setup_cmd64x(struct pci_dev *dev, ide_pci_device_t *d) | |||
604 | 602 | ||
605 | static int __devinit init_setup_cmd646(struct pci_dev *dev, ide_pci_device_t *d) | 603 | static int __devinit init_setup_cmd646(struct pci_dev *dev, ide_pci_device_t *d) |
606 | { | 604 | { |
607 | u8 rev = 0; | ||
608 | |||
609 | /* | 605 | /* |
610 | * The original PCI0646 didn't have the primary channel enable bit, | 606 | * The original PCI0646 didn't have the primary channel enable bit, |
611 | * it appeared starting with PCI0646U (i.e. revision ID 3). | 607 | * it appeared starting with PCI0646U (i.e. revision ID 3). |
612 | */ | 608 | */ |
613 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | 609 | if (dev->revision < 3) |
614 | if (rev < 3) | ||
615 | d->enablebits[0].reg = 0; | 610 | d->enablebits[0].reg = 0; |
616 | 611 | ||
617 | return ide_setup_pci_device(dev, d); | 612 | return ide_setup_pci_device(dev, d); |
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c index 4b6bae8eee82..e9b07a97c340 100644 --- a/drivers/ide/pci/hpt366.c +++ b/drivers/ide/pci/hpt366.c | |||
@@ -1413,11 +1413,9 @@ static int __devinit init_setup_hpt372n(struct pci_dev *dev, ide_pci_device_t *d | |||
1413 | static int __devinit init_setup_hpt371(struct pci_dev *dev, ide_pci_device_t *d) | 1413 | static int __devinit init_setup_hpt371(struct pci_dev *dev, ide_pci_device_t *d) |
1414 | { | 1414 | { |
1415 | struct hpt_info *info; | 1415 | struct hpt_info *info; |
1416 | u8 rev = 0, mcr1 = 0; | 1416 | u8 mcr1 = 0; |
1417 | 1417 | ||
1418 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | 1418 | if (dev->revision > 1) { |
1419 | |||
1420 | if (rev > 1) { | ||
1421 | d->name = "HPT371N"; | 1419 | d->name = "HPT371N"; |
1422 | 1420 | ||
1423 | info = &hpt371n; | 1421 | info = &hpt371n; |
@@ -1442,11 +1440,8 @@ static int __devinit init_setup_hpt371(struct pci_dev *dev, ide_pci_device_t *d) | |||
1442 | static int __devinit init_setup_hpt372a(struct pci_dev *dev, ide_pci_device_t *d) | 1440 | static int __devinit init_setup_hpt372a(struct pci_dev *dev, ide_pci_device_t *d) |
1443 | { | 1441 | { |
1444 | struct hpt_info *info; | 1442 | struct hpt_info *info; |
1445 | u8 rev = 0; | ||
1446 | |||
1447 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | ||
1448 | 1443 | ||
1449 | if (rev > 1) { | 1444 | if (dev->revision > 1) { |
1450 | d->name = "HPT372N"; | 1445 | d->name = "HPT372N"; |
1451 | 1446 | ||
1452 | info = &hpt372n; | 1447 | info = &hpt372n; |
@@ -1460,11 +1455,8 @@ static int __devinit init_setup_hpt372a(struct pci_dev *dev, ide_pci_device_t *d | |||
1460 | static int __devinit init_setup_hpt302(struct pci_dev *dev, ide_pci_device_t *d) | 1455 | static int __devinit init_setup_hpt302(struct pci_dev *dev, ide_pci_device_t *d) |
1461 | { | 1456 | { |
1462 | struct hpt_info *info; | 1457 | struct hpt_info *info; |
1463 | u8 rev = 0; | ||
1464 | 1458 | ||
1465 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | 1459 | if (dev->revision > 1) { |
1466 | |||
1467 | if (rev > 1) { | ||
1468 | d->name = "HPT302N"; | 1460 | d->name = "HPT302N"; |
1469 | 1461 | ||
1470 | info = &hpt302n; | 1462 | info = &hpt302n; |
@@ -1478,7 +1470,7 @@ static int __devinit init_setup_hpt302(struct pci_dev *dev, ide_pci_device_t *d) | |||
1478 | static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d) | 1470 | static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d) |
1479 | { | 1471 | { |
1480 | struct pci_dev *dev2; | 1472 | struct pci_dev *dev2; |
1481 | u8 rev = 0; | 1473 | u8 rev = dev->revision; |
1482 | static char *chipset_names[] = { "HPT366", "HPT366", "HPT368", | 1474 | static char *chipset_names[] = { "HPT366", "HPT366", "HPT368", |
1483 | "HPT370", "HPT370A", "HPT372", | 1475 | "HPT370", "HPT370A", "HPT372", |
1484 | "HPT372N" }; | 1476 | "HPT372N" }; |
@@ -1489,8 +1481,6 @@ static int __devinit init_setup_hpt366(struct pci_dev *dev, ide_pci_device_t *d) | |||
1489 | if (PCI_FUNC(dev->devfn) & 1) | 1481 | if (PCI_FUNC(dev->devfn) & 1) |
1490 | return -ENODEV; | 1482 | return -ENODEV; |
1491 | 1483 | ||
1492 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | ||
1493 | |||
1494 | switch (rev) { | 1484 | switch (rev) { |
1495 | case 0: | 1485 | case 0: |
1496 | case 1: | 1486 | case 1: |
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 2e0b29ef596a..1372c35be035 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c | |||
@@ -572,18 +572,16 @@ static void __devinit piix_check_450nx(void) | |||
572 | { | 572 | { |
573 | struct pci_dev *pdev = NULL; | 573 | struct pci_dev *pdev = NULL; |
574 | u16 cfg; | 574 | u16 cfg; |
575 | u8 rev; | ||
576 | while((pdev=pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL) | 575 | while((pdev=pci_get_device(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82454NX, pdev))!=NULL) |
577 | { | 576 | { |
578 | /* Look for 450NX PXB. Check for problem configurations | 577 | /* Look for 450NX PXB. Check for problem configurations |
579 | A PCI quirk checks bit 6 already */ | 578 | A PCI quirk checks bit 6 already */ |
580 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
581 | pci_read_config_word(pdev, 0x41, &cfg); | 579 | pci_read_config_word(pdev, 0x41, &cfg); |
582 | /* Only on the original revision: IDE DMA can hang */ | 580 | /* Only on the original revision: IDE DMA can hang */ |
583 | if(rev == 0x00) | 581 | if (pdev->revision == 0x00) |
584 | no_piix_dma = 1; | 582 | no_piix_dma = 1; |
585 | /* On all revisions below 5 PXB bus lock must be disabled for IDE */ | 583 | /* On all revisions below 5 PXB bus lock must be disabled for IDE */ |
586 | else if(cfg & (1<<14) && rev < 5) | 584 | else if (cfg & (1<<14) && pdev->revision < 5) |
587 | no_piix_dma = 2; | 585 | no_piix_dma = 2; |
588 | } | 586 | } |
589 | if(no_piix_dma) | 587 | if(no_piix_dma) |
diff --git a/drivers/ide/pci/serverworks.c b/drivers/ide/pci/serverworks.c index 1371b5bf6bf0..ed04e0c8dd4c 100644 --- a/drivers/ide/pci/serverworks.c +++ b/drivers/ide/pci/serverworks.c | |||
@@ -55,7 +55,6 @@ static const char *svwks_bad_ata100[] = { | |||
55 | NULL | 55 | NULL |
56 | }; | 56 | }; |
57 | 57 | ||
58 | static u8 svwks_revision = 0; | ||
59 | static struct pci_dev *isa_dev; | 58 | static struct pci_dev *isa_dev; |
60 | 59 | ||
61 | static int check_in_drive_lists (ide_drive_t *drive, const char **list) | 60 | static int check_in_drive_lists (ide_drive_t *drive, const char **list) |
@@ -71,9 +70,6 @@ static u8 svwks_udma_filter(ide_drive_t *drive) | |||
71 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 70 | struct pci_dev *dev = HWIF(drive)->pci_dev; |
72 | u8 mask = 0; | 71 | u8 mask = 0; |
73 | 72 | ||
74 | if (!svwks_revision) | ||
75 | pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); | ||
76 | |||
77 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) | 73 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_HT1000IDE) |
78 | return 0x1f; | 74 | return 0x1f; |
79 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { | 75 | if (dev->device == PCI_DEVICE_ID_SERVERWORKS_OSB4IDE) { |
@@ -88,9 +84,9 @@ static u8 svwks_udma_filter(ide_drive_t *drive) | |||
88 | return 0; | 84 | return 0; |
89 | /* Check the OSB4 DMA33 enable bit */ | 85 | /* Check the OSB4 DMA33 enable bit */ |
90 | return ((reg & 0x00004000) == 0x00004000) ? 0x07 : 0; | 86 | return ((reg & 0x00004000) == 0x00004000) ? 0x07 : 0; |
91 | } else if (svwks_revision < SVWKS_CSB5_REVISION_NEW) { | 87 | } else if (dev->revision < SVWKS_CSB5_REVISION_NEW) { |
92 | return 0x07; | 88 | return 0x07; |
93 | } else if (svwks_revision >= SVWKS_CSB5_REVISION_NEW) { | 89 | } else if (dev->revision >= SVWKS_CSB5_REVISION_NEW) { |
94 | u8 btr = 0, mode; | 90 | u8 btr = 0, mode; |
95 | pci_read_config_byte(dev, 0x5A, &btr); | 91 | pci_read_config_byte(dev, 0x5A, &btr); |
96 | mode = btr & 0x3; | 92 | mode = btr & 0x3; |
@@ -234,9 +230,6 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
234 | unsigned int reg; | 230 | unsigned int reg; |
235 | u8 btr; | 231 | u8 btr; |
236 | 232 | ||
237 | /* save revision id to determine DMA capability */ | ||
238 | pci_read_config_byte(dev, PCI_REVISION_ID, &svwks_revision); | ||
239 | |||
240 | /* force Master Latency Timer value to 64 PCICLKs */ | 233 | /* force Master Latency Timer value to 64 PCICLKs */ |
241 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x40); | 234 | pci_write_config_byte(dev, PCI_LATENCY_TIMER, 0x40); |
242 | 235 | ||
@@ -315,7 +308,7 @@ static unsigned int __devinit init_chipset_svwks (struct pci_dev *dev, const cha | |||
315 | if (!(PCI_FUNC(dev->devfn) & 1)) | 308 | if (!(PCI_FUNC(dev->devfn) & 1)) |
316 | btr |= 0x2; | 309 | btr |= 0x2; |
317 | else | 310 | else |
318 | btr |= (svwks_revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; | 311 | btr |= (dev->revision >= SVWKS_CSB5_REVISION_NEW) ? 0x3 : 0x2; |
319 | pci_write_config_byte(dev, 0x5A, btr); | 312 | pci_write_config_byte(dev, 0x5A, btr); |
320 | } | 313 | } |
321 | /* Setup HT1000 SouthBridge Controller - Single Channel Only */ | 314 | /* Setup HT1000 SouthBridge Controller - Single Channel Only */ |
diff --git a/drivers/ide/pci/sis5513.c b/drivers/ide/pci/sis5513.c index f875183ac8d9..756a9b6eb462 100644 --- a/drivers/ide/pci/sis5513.c +++ b/drivers/ide/pci/sis5513.c | |||
@@ -659,9 +659,7 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c | |||
659 | 659 | ||
660 | /* Special case for SiS630 : 630S/ET is ATA_100a */ | 660 | /* Special case for SiS630 : 630S/ET is ATA_100a */ |
661 | if (SiSHostChipInfo[i].host_id == PCI_DEVICE_ID_SI_630) { | 661 | if (SiSHostChipInfo[i].host_id == PCI_DEVICE_ID_SI_630) { |
662 | u8 hostrev; | 662 | if (host->revision >= 0x30) |
663 | pci_read_config_byte(host, PCI_REVISION_ID, &hostrev); | ||
664 | if (hostrev >= 0x30) | ||
665 | chipset_family = ATA_100a; | 663 | chipset_family = ATA_100a; |
666 | } | 664 | } |
667 | pci_dev_put(host); | 665 | pci_dev_put(host); |
@@ -702,7 +700,6 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c | |||
702 | u16 trueid; | 700 | u16 trueid; |
703 | u8 prefctl; | 701 | u8 prefctl; |
704 | u8 idecfg; | 702 | u8 idecfg; |
705 | u8 sbrev; | ||
706 | 703 | ||
707 | pci_read_config_byte(dev, 0x4a, &idecfg); | 704 | pci_read_config_byte(dev, 0x4a, &idecfg); |
708 | pci_write_config_byte(dev, 0x4a, idecfg | 0x10); | 705 | pci_write_config_byte(dev, 0x4a, idecfg | 0x10); |
@@ -712,11 +709,10 @@ static unsigned int __devinit init_chipset_sis5513 (struct pci_dev *dev, const c | |||
712 | if (trueid == 0x5517) { /* SiS 961/961B */ | 709 | if (trueid == 0x5517) { /* SiS 961/961B */ |
713 | 710 | ||
714 | lpc_bridge = pci_get_slot(dev->bus, 0x10); /* Bus 0, Dev 2, Fn 0 */ | 711 | lpc_bridge = pci_get_slot(dev->bus, 0x10); /* Bus 0, Dev 2, Fn 0 */ |
715 | pci_read_config_byte(lpc_bridge, PCI_REVISION_ID, &sbrev); | ||
716 | pci_read_config_byte(dev, 0x49, &prefctl); | 712 | pci_read_config_byte(dev, 0x49, &prefctl); |
717 | pci_dev_put(lpc_bridge); | 713 | pci_dev_put(lpc_bridge); |
718 | 714 | ||
719 | if (sbrev == 0x10 && (prefctl & 0x80)) { | 715 | if (lpc_bridge->revision == 0x10 && (prefctl & 0x80)) { |
720 | printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n"); | 716 | printk(KERN_INFO "SIS5513: SiS 961B MuTIOL IDE UDMA133 controller\n"); |
721 | chipset_family = ATA_133a; | 717 | chipset_family = ATA_133a; |
722 | } else { | 718 | } else { |
diff --git a/drivers/ide/pci/sl82c105.c b/drivers/ide/pci/sl82c105.c index 487879842af4..a7323d278c49 100644 --- a/drivers/ide/pci/sl82c105.c +++ b/drivers/ide/pci/sl82c105.c | |||
@@ -338,7 +338,6 @@ static void sl82c105_tune_drive(ide_drive_t *drive, u8 pio) | |||
338 | static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) | 338 | static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) |
339 | { | 339 | { |
340 | struct pci_dev *bridge; | 340 | struct pci_dev *bridge; |
341 | u8 rev; | ||
342 | 341 | ||
343 | /* | 342 | /* |
344 | * The bridge should be part of the same device, but function 0. | 343 | * The bridge should be part of the same device, but function 0. |
@@ -360,10 +359,9 @@ static unsigned int sl82c105_bridge_revision(struct pci_dev *dev) | |||
360 | /* | 359 | /* |
361 | * We need to find function 0's revision, not function 1 | 360 | * We need to find function 0's revision, not function 1 |
362 | */ | 361 | */ |
363 | pci_read_config_byte(bridge, PCI_REVISION_ID, &rev); | ||
364 | pci_dev_put(bridge); | 362 | pci_dev_put(bridge); |
365 | 363 | ||
366 | return rev; | 364 | return bridge->revision; |
367 | } | 365 | } |
368 | 366 | ||
369 | /* | 367 | /* |
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) | |||
237 | static struct via_isa_bridge *via_config_find(struct pci_dev **isa) | 237 | static 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], |
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index e3a223209710..834e86f6c04e 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
@@ -270,7 +270,6 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, | |||
270 | struct ipath_devdata *dd; | 270 | struct ipath_devdata *dd; |
271 | unsigned long long addr; | 271 | unsigned long long addr; |
272 | u32 bar0 = 0, bar1 = 0; | 272 | u32 bar0 = 0, bar1 = 0; |
273 | u8 rev; | ||
274 | 273 | ||
275 | dd = ipath_alloc_devdata(pdev); | 274 | dd = ipath_alloc_devdata(pdev); |
276 | if (IS_ERR(dd)) { | 275 | if (IS_ERR(dd)) { |
@@ -432,13 +431,7 @@ static int __devinit ipath_init_one(struct pci_dev *pdev, | |||
432 | dd->ipath_deviceid = ent->device; /* save for later use */ | 431 | dd->ipath_deviceid = ent->device; /* save for later use */ |
433 | dd->ipath_vendorid = ent->vendor; | 432 | dd->ipath_vendorid = ent->vendor; |
434 | 433 | ||
435 | ret = pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | 434 | dd->ipath_pcirev = pdev->revision; |
436 | if (ret) { | ||
437 | ipath_dev_err(dd, "Failed to read PCI revision ID unit " | ||
438 | "%u: err %d\n", dd->ipath_unit, -ret); | ||
439 | goto bail_regions; /* shouldn't ever happen */ | ||
440 | } | ||
441 | dd->ipath_pcirev = rev; | ||
442 | 435 | ||
443 | #if defined(__powerpc__) | 436 | #if defined(__powerpc__) |
444 | /* There isn't a generic way to specify writethrough mappings */ | 437 | /* There isn't a generic way to specify writethrough mappings */ |
diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c index 340310645346..6339bb443f62 100644 --- a/drivers/isdn/hisax/bkm_a8.c +++ b/drivers/isdn/hisax/bkm_a8.c | |||
@@ -287,7 +287,6 @@ setup_sct_quadro(struct IsdnCard *card) | |||
287 | #ifdef CONFIG_PCI | 287 | #ifdef CONFIG_PCI |
288 | struct IsdnCardState *cs = card->cs; | 288 | struct IsdnCardState *cs = card->cs; |
289 | char tmp[64]; | 289 | char tmp[64]; |
290 | u_char pci_rev_id; | ||
291 | u_int found = 0; | 290 | u_int found = 0; |
292 | u_int pci_ioaddr1, pci_ioaddr2, pci_ioaddr3, pci_ioaddr4, pci_ioaddr5; | 291 | u_int pci_ioaddr1, pci_ioaddr2, pci_ioaddr3, pci_ioaddr4, pci_ioaddr5; |
293 | 292 | ||
@@ -335,8 +334,7 @@ setup_sct_quadro(struct IsdnCard *card) | |||
335 | } | 334 | } |
336 | #ifdef ATTEMPT_PCI_REMAPPING | 335 | #ifdef ATTEMPT_PCI_REMAPPING |
337 | /* HACK: PLX revision 1 bug: PLX address bit 7 must not be set */ | 336 | /* HACK: PLX revision 1 bug: PLX address bit 7 must not be set */ |
338 | pci_read_config_byte(dev_a8, PCI_REVISION_ID, &pci_rev_id); | 337 | if ((pci_ioaddr1 & 0x80) && (dev_a8->revision == 1)) { |
339 | if ((pci_ioaddr1 & 0x80) && (pci_rev_id == 1)) { | ||
340 | printk(KERN_WARNING "HiSax: %s (%s): PLX rev 1, remapping required!\n", | 338 | printk(KERN_WARNING "HiSax: %s (%s): PLX rev 1, remapping required!\n", |
341 | CardType[card->typ], | 339 | CardType[card->typ], |
342 | sct_quadro_subtypes[cs->subtyp]); | 340 | sct_quadro_subtypes[cs->subtyp]); |
diff --git a/drivers/media/radio/radio-gemtek-pci.c b/drivers/media/radio/radio-gemtek-pci.c index fdf5d6e46eac..5e6f17df204b 100644 --- a/drivers/media/radio/radio-gemtek-pci.c +++ b/drivers/media/radio/radio-gemtek-pci.c | |||
@@ -94,7 +94,6 @@ struct gemtek_pci_card { | |||
94 | 94 | ||
95 | u32 iobase; | 95 | u32 iobase; |
96 | u32 length; | 96 | u32 length; |
97 | u8 chiprev; | ||
98 | u16 model; | 97 | u16 model; |
99 | 98 | ||
100 | u32 current_frequency; | 99 | u32 current_frequency; |
@@ -415,7 +414,6 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci | |||
415 | goto err_pci; | 414 | goto err_pci; |
416 | } | 415 | } |
417 | 416 | ||
418 | pci_read_config_byte( pci_dev, PCI_REVISION_ID, &card->chiprev ); | ||
419 | pci_read_config_word( pci_dev, PCI_SUBSYSTEM_ID, &card->model ); | 417 | pci_read_config_word( pci_dev, PCI_SUBSYSTEM_ID, &card->model ); |
420 | 418 | ||
421 | pci_set_drvdata( pci_dev, card ); | 419 | pci_set_drvdata( pci_dev, card ); |
@@ -436,7 +434,7 @@ static int __devinit gemtek_pci_probe( struct pci_dev *pci_dev, const struct pci | |||
436 | gemtek_pci_mute( card ); | 434 | gemtek_pci_mute( card ); |
437 | 435 | ||
438 | printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n", | 436 | printk( KERN_INFO "Gemtek PCI Radio (rev. %d) found at 0x%04x-0x%04x.\n", |
439 | card->chiprev, card->iobase, card->iobase + card->length - 1 ); | 437 | pci_dev->revision, card->iobase, card->iobase + card->length - 1 ); |
440 | 438 | ||
441 | return 0; | 439 | return 0; |
442 | 440 | ||
diff --git a/drivers/media/video/meye.c b/drivers/media/video/meye.c index 664aba8b4d85..7533fc203319 100644 --- a/drivers/media/video/meye.c +++ b/drivers/media/video/meye.c | |||
@@ -1809,7 +1809,6 @@ static int __devinit meye_probe(struct pci_dev *pcidev, | |||
1809 | { | 1809 | { |
1810 | int ret = -EBUSY; | 1810 | int ret = -EBUSY; |
1811 | unsigned long mchip_adr; | 1811 | unsigned long mchip_adr; |
1812 | u8 revision; | ||
1813 | 1812 | ||
1814 | if (meye.mchip_dev != NULL) { | 1813 | if (meye.mchip_dev != NULL) { |
1815 | printk(KERN_ERR "meye: only one device allowed!\n"); | 1814 | printk(KERN_ERR "meye: only one device allowed!\n"); |
@@ -1885,7 +1884,6 @@ static int __devinit meye_probe(struct pci_dev *pcidev, | |||
1885 | goto outreqirq; | 1884 | goto outreqirq; |
1886 | } | 1885 | } |
1887 | 1886 | ||
1888 | pci_read_config_byte(meye.mchip_dev, PCI_REVISION_ID, &revision); | ||
1889 | pci_write_config_byte(meye.mchip_dev, PCI_CACHE_LINE_SIZE, 8); | 1887 | pci_write_config_byte(meye.mchip_dev, PCI_CACHE_LINE_SIZE, 8); |
1890 | pci_write_config_byte(meye.mchip_dev, PCI_LATENCY_TIMER, 64); | 1888 | pci_write_config_byte(meye.mchip_dev, PCI_LATENCY_TIMER, 64); |
1891 | 1889 | ||
@@ -1939,7 +1937,7 @@ static int __devinit meye_probe(struct pci_dev *pcidev, | |||
1939 | printk(KERN_INFO "meye: Motion Eye Camera Driver v%s.\n", | 1937 | printk(KERN_INFO "meye: Motion Eye Camera Driver v%s.\n", |
1940 | MEYE_DRIVER_VERSION); | 1938 | MEYE_DRIVER_VERSION); |
1941 | printk(KERN_INFO "meye: mchip KL5A72002 rev. %d, base %lx, irq %d\n", | 1939 | printk(KERN_INFO "meye: mchip KL5A72002 rev. %d, base %lx, irq %d\n", |
1942 | revision, mchip_adr, meye.mchip_irq); | 1940 | meye.mchip_dev->revision, mchip_adr, meye.mchip_irq); |
1943 | 1941 | ||
1944 | return 0; | 1942 | return 0; |
1945 | 1943 | ||
diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index 58bbc3e6d0de..807e6992e614 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c | |||
@@ -1799,7 +1799,6 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1799 | void __iomem *regs; | 1799 | void __iomem *regs; |
1800 | resource_size_t pciaddr; | 1800 | resource_size_t pciaddr; |
1801 | unsigned int addr_len, i, pci_using_dac; | 1801 | unsigned int addr_len, i, pci_using_dac; |
1802 | u8 pci_rev; | ||
1803 | 1802 | ||
1804 | #ifndef MODULE | 1803 | #ifndef MODULE |
1805 | static int version_printed; | 1804 | static int version_printed; |
@@ -1807,13 +1806,11 @@ static int cp_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1807 | printk("%s", version); | 1806 | printk("%s", version); |
1808 | #endif | 1807 | #endif |
1809 | 1808 | ||
1810 | pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); | ||
1811 | |||
1812 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 1809 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
1813 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev < 0x20) { | 1810 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision < 0x20) { |
1814 | dev_err(&pdev->dev, | 1811 | dev_err(&pdev->dev, |
1815 | "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", | 1812 | "This (id %04x:%04x rev %02x) is not an 8139C+ compatible chip\n", |
1816 | pdev->vendor, pdev->device, pci_rev); | 1813 | pdev->vendor, pdev->device, pdev->revision); |
1817 | dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); | 1814 | dev_err(&pdev->dev, "Try the \"8139too\" driver instead.\n"); |
1818 | return -ENODEV; | 1815 | return -ENODEV; |
1819 | } | 1816 | } |
diff --git a/drivers/net/8139too.c b/drivers/net/8139too.c index a844b1fe2dc4..77457c7c6ac2 100644 --- a/drivers/net/8139too.c +++ b/drivers/net/8139too.c | |||
@@ -931,7 +931,6 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
931 | int i, addr_len, option; | 931 | int i, addr_len, option; |
932 | void __iomem *ioaddr; | 932 | void __iomem *ioaddr; |
933 | static int board_idx = -1; | 933 | static int board_idx = -1; |
934 | u8 pci_rev; | ||
935 | 934 | ||
936 | assert (pdev != NULL); | 935 | assert (pdev != NULL); |
937 | assert (ent != NULL); | 936 | assert (ent != NULL); |
@@ -949,13 +948,11 @@ static int __devinit rtl8139_init_one (struct pci_dev *pdev, | |||
949 | } | 948 | } |
950 | #endif | 949 | #endif |
951 | 950 | ||
952 | pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); | ||
953 | |||
954 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && | 951 | if (pdev->vendor == PCI_VENDOR_ID_REALTEK && |
955 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pci_rev >= 0x20) { | 952 | pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) { |
956 | dev_info(&pdev->dev, | 953 | dev_info(&pdev->dev, |
957 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", | 954 | "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n", |
958 | pdev->vendor, pdev->device, pci_rev); | 955 | pdev->vendor, pdev->device, pdev->revision); |
959 | dev_info(&pdev->dev, | 956 | dev_info(&pdev->dev, |
960 | "Use the \"8139cp\" driver for improved performance and stability.\n"); | 957 | "Use the \"8139cp\" driver for improved performance and stability.\n"); |
961 | } | 958 | } |
diff --git a/drivers/net/atl1/atl1.h b/drivers/net/atl1/atl1.h index b1c6034e68fa..df4c1a0071aa 100644 --- a/drivers/net/atl1/atl1.h +++ b/drivers/net/atl1/atl1.h | |||
@@ -210,7 +210,6 @@ struct atl1_hw { | |||
210 | u16 phy_spd_default; | 210 | u16 phy_spd_default; |
211 | 211 | ||
212 | u16 dev_rev; | 212 | u16 dev_rev; |
213 | u8 revision_id; | ||
214 | 213 | ||
215 | /* spi flash */ | 214 | /* spi flash */ |
216 | u8 flash_vendor; | 215 | u8 flash_vendor; |
diff --git a/drivers/net/atl1/atl1_main.c b/drivers/net/atl1/atl1_main.c index 3bb40dd4a410..501919eb7f5e 100644 --- a/drivers/net/atl1/atl1_main.c +++ b/drivers/net/atl1/atl1_main.c | |||
@@ -118,10 +118,6 @@ static int __devinit atl1_sw_init(struct atl1_adapter *adapter) | |||
118 | { | 118 | { |
119 | struct atl1_hw *hw = &adapter->hw; | 119 | struct atl1_hw *hw = &adapter->hw; |
120 | struct net_device *netdev = adapter->netdev; | 120 | struct net_device *netdev = adapter->netdev; |
121 | struct pci_dev *pdev = adapter->pdev; | ||
122 | |||
123 | /* PCI config space info */ | ||
124 | pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id); | ||
125 | 121 | ||
126 | hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; | 122 | hw->max_frame_size = netdev->mtu + ENET_HEADER_SIZE + ETHERNET_FCS_SIZE; |
127 | hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE; | 123 | hw->min_frame_size = MINIMUM_ETHERNET_FRAME_SIZE; |
diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index ce3ed67a878e..23958f73c421 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c | |||
@@ -6363,10 +6363,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev) | |||
6363 | while ((amd_8132 = pci_get_device(PCI_VENDOR_ID_AMD, | 6363 | while ((amd_8132 = pci_get_device(PCI_VENDOR_ID_AMD, |
6364 | PCI_DEVICE_ID_AMD_8132_BRIDGE, | 6364 | PCI_DEVICE_ID_AMD_8132_BRIDGE, |
6365 | amd_8132))) { | 6365 | amd_8132))) { |
6366 | u8 rev; | ||
6367 | 6366 | ||
6368 | pci_read_config_byte(amd_8132, PCI_REVISION_ID, &rev); | 6367 | if (amd_8132->revision >= 0x10 && |
6369 | if (rev >= 0x10 && rev <= 0x13) { | 6368 | amd_8132->revision <= 0x13) { |
6370 | disable_msi = 1; | 6369 | disable_msi = 1; |
6371 | pci_dev_put(amd_8132); | 6370 | pci_dev_put(amd_8132); |
6372 | break; | 6371 | break; |
diff --git a/drivers/net/cassini.c b/drivers/net/cassini.c index 59b9943b077d..805924fc077a 100644 --- a/drivers/net/cassini.c +++ b/drivers/net/cassini.c | |||
@@ -3422,21 +3422,19 @@ done: | |||
3422 | static void cas_check_pci_invariants(struct cas *cp) | 3422 | static void cas_check_pci_invariants(struct cas *cp) |
3423 | { | 3423 | { |
3424 | struct pci_dev *pdev = cp->pdev; | 3424 | struct pci_dev *pdev = cp->pdev; |
3425 | u8 rev; | ||
3426 | 3425 | ||
3427 | cp->cas_flags = 0; | 3426 | cp->cas_flags = 0; |
3428 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
3429 | if ((pdev->vendor == PCI_VENDOR_ID_SUN) && | 3427 | if ((pdev->vendor == PCI_VENDOR_ID_SUN) && |
3430 | (pdev->device == PCI_DEVICE_ID_SUN_CASSINI)) { | 3428 | (pdev->device == PCI_DEVICE_ID_SUN_CASSINI)) { |
3431 | if (rev >= CAS_ID_REVPLUS) | 3429 | if (pdev->revision >= CAS_ID_REVPLUS) |
3432 | cp->cas_flags |= CAS_FLAG_REG_PLUS; | 3430 | cp->cas_flags |= CAS_FLAG_REG_PLUS; |
3433 | if (rev < CAS_ID_REVPLUS02u) | 3431 | if (pdev->revision < CAS_ID_REVPLUS02u) |
3434 | cp->cas_flags |= CAS_FLAG_TARGET_ABORT; | 3432 | cp->cas_flags |= CAS_FLAG_TARGET_ABORT; |
3435 | 3433 | ||
3436 | /* Original Cassini supports HW CSUM, but it's not | 3434 | /* Original Cassini supports HW CSUM, but it's not |
3437 | * enabled by default as it can trigger TX hangs. | 3435 | * enabled by default as it can trigger TX hangs. |
3438 | */ | 3436 | */ |
3439 | if (rev < CAS_ID_REV2) | 3437 | if (pdev->revision < CAS_ID_REV2) |
3440 | cp->cas_flags |= CAS_FLAG_NO_HW_CSUM; | 3438 | cp->cas_flags |= CAS_FLAG_NO_HW_CSUM; |
3441 | } else { | 3439 | } else { |
3442 | /* Only sun has original cassini chips. */ | 3440 | /* Only sun has original cassini chips. */ |
diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 74ec64a1625d..fab4fc9f7fd0 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c | |||
@@ -250,7 +250,6 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
250 | np->an_enable = 1; | 250 | np->an_enable = 1; |
251 | mii_set_media (dev); | 251 | mii_set_media (dev); |
252 | } | 252 | } |
253 | pci_read_config_byte(pdev, PCI_REVISION_ID, &np->pci_rev_id); | ||
254 | 253 | ||
255 | err = register_netdev (dev); | 254 | err = register_netdev (dev); |
256 | if (err) | 255 | if (err) |
@@ -879,7 +878,7 @@ receive_packet (struct net_device *dev) | |||
879 | skb->protocol = eth_type_trans (skb, dev); | 878 | skb->protocol = eth_type_trans (skb, dev); |
880 | #if 0 | 879 | #if 0 |
881 | /* Checksum done by hw, but csum value unavailable. */ | 880 | /* Checksum done by hw, but csum value unavailable. */ |
882 | if (np->pci_rev_id >= 0x0c && | 881 | if (np->pdev->pci_rev_id >= 0x0c && |
883 | !(frame_status & (TCPError | UDPError | IPError))) { | 882 | !(frame_status & (TCPError | UDPError | IPError))) { |
884 | skb->ip_summed = CHECKSUM_UNNECESSARY; | 883 | skb->ip_summed = CHECKSUM_UNNECESSARY; |
885 | } | 884 | } |
diff --git a/drivers/net/dl2k.h b/drivers/net/dl2k.h index 814c449c359f..e443065a452e 100644 --- a/drivers/net/dl2k.h +++ b/drivers/net/dl2k.h | |||
@@ -668,7 +668,6 @@ struct netdev_private { | |||
668 | unsigned int rx_flow:1; /* Rx flow control enable */ | 668 | unsigned int rx_flow:1; /* Rx flow control enable */ |
669 | unsigned int phy_media:1; /* 1: fiber, 0: copper */ | 669 | unsigned int phy_media:1; /* 1: fiber, 0: copper */ |
670 | unsigned int link_status:1; /* Current link status */ | 670 | unsigned int link_status:1; /* Current link status */ |
671 | unsigned char pci_rev_id; /* PCI revision ID */ | ||
672 | struct netdev_desc *last_tx; /* Last Tx descriptor used. */ | 671 | struct netdev_desc *last_tx; /* Last Tx descriptor used. */ |
673 | unsigned long cur_rx, old_rx; /* Producer/consumer ring indices */ | 672 | unsigned long cur_rx, old_rx; /* Producer/consumer ring indices */ |
674 | unsigned long cur_tx, old_tx; | 673 | unsigned long cur_tx, old_tx; |
diff --git a/drivers/net/e100.c b/drivers/net/e100.c index 74ea6373c7cd..6b6401e9304e 100644 --- a/drivers/net/e100.c +++ b/drivers/net/e100.c | |||
@@ -583,7 +583,6 @@ struct nic { | |||
583 | u32 rx_tco_frames; | 583 | u32 rx_tco_frames; |
584 | u32 rx_over_length_errors; | 584 | u32 rx_over_length_errors; |
585 | 585 | ||
586 | u8 rev_id; | ||
587 | u16 leds; | 586 | u16 leds; |
588 | u16 eeprom_wc; | 587 | u16 eeprom_wc; |
589 | u16 eeprom[256]; | 588 | u16 eeprom[256]; |
@@ -937,9 +936,8 @@ static void e100_get_defaults(struct nic *nic) | |||
937 | struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; | 936 | struct param_range rfds = { .min = 16, .max = 256, .count = 256 }; |
938 | struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; | 937 | struct param_range cbs = { .min = 64, .max = 256, .count = 128 }; |
939 | 938 | ||
940 | pci_read_config_byte(nic->pdev, PCI_REVISION_ID, &nic->rev_id); | ||
941 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ | 939 | /* MAC type is encoded as rev ID; exception: ICH is treated as 82559 */ |
942 | nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->rev_id; | 940 | nic->mac = (nic->flags & ich) ? mac_82559_D101M : nic->pdev->revision; |
943 | if(nic->mac == mac_unknown) | 941 | if(nic->mac == mac_unknown) |
944 | nic->mac = mac_82557_D100_A; | 942 | nic->mac = mac_82557_D100_A; |
945 | 943 | ||
@@ -1279,7 +1277,7 @@ static void e100_setup_ucode(struct nic *nic, struct cb *cb, struct sk_buff *skb | |||
1279 | if (nic->flags & ich) | 1277 | if (nic->flags & ich) |
1280 | goto noloaducode; | 1278 | goto noloaducode; |
1281 | 1279 | ||
1282 | /* Search for ucode match against h/w rev_id */ | 1280 | /* Search for ucode match against h/w revision */ |
1283 | for (opts = ucode_opts; opts->mac; opts++) { | 1281 | for (opts = ucode_opts; opts->mac; opts++) { |
1284 | int i; | 1282 | int i; |
1285 | u32 *ucode = opts->ucode; | 1283 | u32 *ucode = opts->ucode; |
@@ -2238,7 +2236,7 @@ static void e100_get_regs(struct net_device *netdev, | |||
2238 | u32 *buff = p; | 2236 | u32 *buff = p; |
2239 | int i; | 2237 | int i; |
2240 | 2238 | ||
2241 | regs->version = (1 << 24) | nic->rev_id; | 2239 | regs->version = (1 << 24) | nic->pdev->revision; |
2242 | buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 | | 2240 | buff[0] = ioread8(&nic->csr->scb.cmd_hi) << 24 | |
2243 | ioread8(&nic->csr->scb.cmd_lo) << 16 | | 2241 | ioread8(&nic->csr->scb.cmd_lo) << 16 | |
2244 | ioread16(&nic->csr->scb.status); | 2242 | ioread16(&nic->csr->scb.status); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index cf8af928a69c..f48b659e0c2b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -1266,8 +1266,7 @@ e1000_sw_init(struct e1000_adapter *adapter) | |||
1266 | hw->device_id = pdev->device; | 1266 | hw->device_id = pdev->device; |
1267 | hw->subsystem_vendor_id = pdev->subsystem_vendor; | 1267 | hw->subsystem_vendor_id = pdev->subsystem_vendor; |
1268 | hw->subsystem_id = pdev->subsystem_device; | 1268 | hw->subsystem_id = pdev->subsystem_device; |
1269 | 1269 | hw->revision_id = pdev->revision; | |
1270 | pci_read_config_byte(pdev, PCI_REVISION_ID, &hw->revision_id); | ||
1271 | 1270 | ||
1272 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); | 1271 | pci_read_config_word(pdev, PCI_COMMAND, &hw->pci_cmd_word); |
1273 | 1272 | ||
diff --git a/drivers/net/forcedeth.c b/drivers/net/forcedeth.c index 42ba1c012ee2..67046e8c21eb 100644 --- a/drivers/net/forcedeth.c +++ b/drivers/net/forcedeth.c | |||
@@ -5084,15 +5084,13 @@ static int __devinit nv_probe(struct pci_dev *pci_dev, const struct pci_device_i | |||
5084 | np->wolenabled = 0; | 5084 | np->wolenabled = 0; |
5085 | 5085 | ||
5086 | if (id->driver_data & DEV_HAS_POWER_CNTRL) { | 5086 | if (id->driver_data & DEV_HAS_POWER_CNTRL) { |
5087 | u8 revision_id; | ||
5088 | pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id); | ||
5089 | 5087 | ||
5090 | /* take phy and nic out of low power mode */ | 5088 | /* take phy and nic out of low power mode */ |
5091 | powerstate = readl(base + NvRegPowerState2); | 5089 | powerstate = readl(base + NvRegPowerState2); |
5092 | powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK; | 5090 | powerstate &= ~NVREG_POWERSTATE2_POWERUP_MASK; |
5093 | if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 || | 5091 | if ((id->device == PCI_DEVICE_ID_NVIDIA_NVENET_12 || |
5094 | id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) && | 5092 | id->device == PCI_DEVICE_ID_NVIDIA_NVENET_13) && |
5095 | revision_id >= 0xA3) | 5093 | pci_dev->revision >= 0xA3) |
5096 | powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3; | 5094 | powerstate |= NVREG_POWERSTATE2_POWERUP_REV_A3; |
5097 | writel(powerstate, base + NvRegPowerState2); | 5095 | writel(powerstate, base + NvRegPowerState2); |
5098 | } | 5096 | } |
diff --git a/drivers/net/netxen/netxen_nic_main.c b/drivers/net/netxen/netxen_nic_main.c index 56f8197b953b..b703ccfe040b 100644 --- a/drivers/net/netxen/netxen_nic_main.c +++ b/drivers/net/netxen/netxen_nic_main.c | |||
@@ -54,8 +54,6 @@ static char netxen_nic_driver_string[] = "NetXen Network Driver version " | |||
54 | #define NETXEN_ADAPTER_UP_MAGIC 777 | 54 | #define NETXEN_ADAPTER_UP_MAGIC 777 |
55 | #define NETXEN_NIC_PEG_TUNE 0 | 55 | #define NETXEN_NIC_PEG_TUNE 0 |
56 | 56 | ||
57 | u8 nx_p2_id = NX_P2_C0; | ||
58 | |||
59 | #define DMA_32BIT_MASK 0x00000000ffffffffULL | 57 | #define DMA_32BIT_MASK 0x00000000ffffffffULL |
60 | #define DMA_35BIT_MASK 0x00000007ffffffffULL | 58 | #define DMA_35BIT_MASK 0x00000007ffffffffULL |
61 | 59 | ||
@@ -307,8 +305,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
307 | goto err_out_disable_pdev; | 305 | goto err_out_disable_pdev; |
308 | 306 | ||
309 | pci_set_master(pdev); | 307 | pci_set_master(pdev); |
310 | pci_read_config_byte(pdev, PCI_REVISION_ID, &nx_p2_id); | 308 | if (pdev->revision == NX_P2_C1 && |
311 | if (nx_p2_id == NX_P2_C1 && | ||
312 | (pci_set_dma_mask(pdev, DMA_35BIT_MASK) == 0) && | 309 | (pci_set_dma_mask(pdev, DMA_35BIT_MASK) == 0) && |
313 | (pci_set_consistent_dma_mask(pdev, DMA_35BIT_MASK) == 0)) { | 310 | (pci_set_consistent_dma_mask(pdev, DMA_35BIT_MASK) == 0)) { |
314 | pci_using_dac = 1; | 311 | pci_using_dac = 1; |
@@ -552,7 +549,7 @@ netxen_nic_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
552 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); | 549 | INIT_WORK(&adapter->watchdog_task, netxen_watchdog_task); |
553 | adapter->ahw.pdev = pdev; | 550 | adapter->ahw.pdev = pdev; |
554 | adapter->proc_cmd_buf_counter = 0; | 551 | adapter->proc_cmd_buf_counter = 0; |
555 | adapter->ahw.revision_id = nx_p2_id; | 552 | adapter->ahw.revision_id = pdev->revision; |
556 | 553 | ||
557 | /* make sure Window == 1 */ | 554 | /* make sure Window == 1 */ |
558 | netxen_nic_pci_change_crbwindow(adapter, 1); | 555 | netxen_nic_pci_change_crbwindow(adapter, 1); |
diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index fa29a403a247..58bbfdd4f901 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c | |||
@@ -1135,7 +1135,7 @@ static int init_nic(struct s2io_nic *nic) | |||
1135 | * SXE-008 TRANSMIT DMA ARBITRATION ISSUE. | 1135 | * SXE-008 TRANSMIT DMA ARBITRATION ISSUE. |
1136 | */ | 1136 | */ |
1137 | if ((nic->device_type == XFRAME_I_DEVICE) && | 1137 | if ((nic->device_type == XFRAME_I_DEVICE) && |
1138 | (get_xena_rev_id(nic->pdev) < 4)) | 1138 | (nic->pdev->revision < 4)) |
1139 | writeq(PCC_ENABLE_FOUR, &bar0->pcc_enable); | 1139 | writeq(PCC_ENABLE_FOUR, &bar0->pcc_enable); |
1140 | 1140 | ||
1141 | val64 = readq(&bar0->tx_fifo_partition_0); | 1141 | val64 = readq(&bar0->tx_fifo_partition_0); |
@@ -1873,7 +1873,7 @@ static int verify_pcc_quiescent(struct s2io_nic *sp, int flag) | |||
1873 | herc = (sp->device_type == XFRAME_II_DEVICE); | 1873 | herc = (sp->device_type == XFRAME_II_DEVICE); |
1874 | 1874 | ||
1875 | if (flag == FALSE) { | 1875 | if (flag == FALSE) { |
1876 | if ((!herc && (get_xena_rev_id(sp->pdev) >= 4)) || herc) { | 1876 | if ((!herc && (sp->pdev->revision >= 4)) || herc) { |
1877 | if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) | 1877 | if (!(val64 & ADAPTER_STATUS_RMAC_PCC_IDLE)) |
1878 | ret = 1; | 1878 | ret = 1; |
1879 | } else { | 1879 | } else { |
@@ -1881,7 +1881,7 @@ static int verify_pcc_quiescent(struct s2io_nic *sp, int flag) | |||
1881 | ret = 1; | 1881 | ret = 1; |
1882 | } | 1882 | } |
1883 | } else { | 1883 | } else { |
1884 | if ((!herc && (get_xena_rev_id(sp->pdev) >= 4)) || herc) { | 1884 | if ((!herc && (sp->pdev->revision >= 4)) || herc) { |
1885 | if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) == | 1885 | if (((val64 & ADAPTER_STATUS_RMAC_PCC_IDLE) == |
1886 | ADAPTER_STATUS_RMAC_PCC_IDLE)) | 1886 | ADAPTER_STATUS_RMAC_PCC_IDLE)) |
1887 | ret = 1; | 1887 | ret = 1; |
@@ -7076,23 +7076,6 @@ static void s2io_link(struct s2io_nic * sp, int link) | |||
7076 | } | 7076 | } |
7077 | 7077 | ||
7078 | /** | 7078 | /** |
7079 | * get_xena_rev_id - to identify revision ID of xena. | ||
7080 | * @pdev : PCI Dev structure | ||
7081 | * Description: | ||
7082 | * Function to identify the Revision ID of xena. | ||
7083 | * Return value: | ||
7084 | * returns the revision ID of the device. | ||
7085 | */ | ||
7086 | |||
7087 | static int get_xena_rev_id(struct pci_dev *pdev) | ||
7088 | { | ||
7089 | u8 id = 0; | ||
7090 | int ret; | ||
7091 | ret = pci_read_config_byte(pdev, PCI_REVISION_ID, (u8 *) & id); | ||
7092 | return id; | ||
7093 | } | ||
7094 | |||
7095 | /** | ||
7096 | * s2io_init_pci -Initialization of PCI and PCI-X configuration registers . | 7079 | * s2io_init_pci -Initialization of PCI and PCI-X configuration registers . |
7097 | * @sp : private member of the device structure, which is a pointer to the | 7080 | * @sp : private member of the device structure, which is a pointer to the |
7098 | * s2io_nic structure. | 7081 | * s2io_nic structure. |
@@ -7550,7 +7533,7 @@ s2io_init_nic(struct pci_dev *pdev, const struct pci_device_id *pre) | |||
7550 | s2io_vpd_read(sp); | 7533 | s2io_vpd_read(sp); |
7551 | DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2007 Neterion Inc.\n"); | 7534 | DBG_PRINT(ERR_DBG, "Copyright(c) 2002-2007 Neterion Inc.\n"); |
7552 | DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, | 7535 | DBG_PRINT(ERR_DBG, "%s: Neterion %s (rev %d)\n",dev->name, |
7553 | sp->product_name, get_xena_rev_id(sp->pdev)); | 7536 | sp->product_name, pdev->revision); |
7554 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, | 7537 | DBG_PRINT(ERR_DBG, "%s: Driver version %s\n", dev->name, |
7555 | s2io_driver_version); | 7538 | s2io_driver_version); |
7556 | DBG_PRINT(ERR_DBG, "%s: MAC ADDR: " | 7539 | DBG_PRINT(ERR_DBG, "%s: MAC ADDR: " |
diff --git a/drivers/net/s2io.h b/drivers/net/s2io.h index 58592780f519..3887fe63a908 100644 --- a/drivers/net/s2io.h +++ b/drivers/net/s2io.h | |||
@@ -1033,7 +1033,6 @@ static void s2io_set_link(struct work_struct *work); | |||
1033 | static int s2io_set_swapper(struct s2io_nic * sp); | 1033 | static int s2io_set_swapper(struct s2io_nic * sp); |
1034 | static void s2io_card_down(struct s2io_nic *nic); | 1034 | static void s2io_card_down(struct s2io_nic *nic); |
1035 | static int s2io_card_up(struct s2io_nic *nic); | 1035 | static int s2io_card_up(struct s2io_nic *nic); |
1036 | static int get_xena_rev_id(struct pci_dev *pdev); | ||
1037 | static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit, | 1036 | static int wait_for_cmd_complete(void __iomem *addr, u64 busy_bit, |
1038 | int bit_state); | 1037 | int bit_state); |
1039 | static int s2io_add_isr(struct s2io_nic * sp); | 1038 | static int s2io_add_isr(struct s2io_nic * sp); |
diff --git a/drivers/net/sundance.c b/drivers/net/sundance.c index e1f912d04043..c9f7b7aa5556 100644 --- a/drivers/net/sundance.c +++ b/drivers/net/sundance.c | |||
@@ -397,7 +397,6 @@ struct netdev_private { | |||
397 | unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ | 397 | unsigned char phys[MII_CNT]; /* MII device addresses, only first one used. */ |
398 | struct pci_dev *pci_dev; | 398 | struct pci_dev *pci_dev; |
399 | void __iomem *base; | 399 | void __iomem *base; |
400 | unsigned char pci_rev_id; | ||
401 | }; | 400 | }; |
402 | 401 | ||
403 | /* The station address location in the EEPROM. */ | 402 | /* The station address location in the EEPROM. */ |
@@ -544,8 +543,6 @@ static int __devinit sundance_probe1 (struct pci_dev *pdev, | |||
544 | dev->change_mtu = &change_mtu; | 543 | dev->change_mtu = &change_mtu; |
545 | pci_set_drvdata(pdev, dev); | 544 | pci_set_drvdata(pdev, dev); |
546 | 545 | ||
547 | pci_read_config_byte(pdev, PCI_REVISION_ID, &np->pci_rev_id); | ||
548 | |||
549 | i = register_netdev(dev); | 546 | i = register_netdev(dev); |
550 | if (i) | 547 | if (i) |
551 | goto err_out_unmap_rx; | 548 | goto err_out_unmap_rx; |
@@ -828,7 +825,7 @@ static int netdev_open(struct net_device *dev) | |||
828 | iowrite8(100, ioaddr + RxDMAPollPeriod); | 825 | iowrite8(100, ioaddr + RxDMAPollPeriod); |
829 | iowrite8(127, ioaddr + TxDMAPollPeriod); | 826 | iowrite8(127, ioaddr + TxDMAPollPeriod); |
830 | /* Fix DFE-580TX packet drop issue */ | 827 | /* Fix DFE-580TX packet drop issue */ |
831 | if (np->pci_rev_id >= 0x14) | 828 | if (np->pci_dev->revision >= 0x14) |
832 | iowrite8(0x01, ioaddr + DebugCtrl1); | 829 | iowrite8(0x01, ioaddr + DebugCtrl1); |
833 | netif_start_queue(dev); | 830 | netif_start_queue(dev); |
834 | 831 | ||
@@ -1194,7 +1191,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance) | |||
1194 | hw_frame_id = ioread8(ioaddr + TxFrameId); | 1191 | hw_frame_id = ioread8(ioaddr + TxFrameId); |
1195 | } | 1192 | } |
1196 | 1193 | ||
1197 | if (np->pci_rev_id >= 0x14) { | 1194 | if (np->pci_dev->revision >= 0x14) { |
1198 | spin_lock(&np->lock); | 1195 | spin_lock(&np->lock); |
1199 | for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) { | 1196 | for (; np->cur_tx - np->dirty_tx > 0; np->dirty_tx++) { |
1200 | int entry = np->dirty_tx % TX_RING_SIZE; | 1197 | int entry = np->dirty_tx % TX_RING_SIZE; |
diff --git a/drivers/net/sunhme.c b/drivers/net/sunhme.c index 15146a119230..8b35f13318ea 100644 --- a/drivers/net/sunhme.c +++ b/drivers/net/sunhme.c | |||
@@ -3095,12 +3095,8 @@ static int __devinit happy_meal_pci_probe(struct pci_dev *pdev, | |||
3095 | 3095 | ||
3096 | #ifdef CONFIG_SPARC | 3096 | #ifdef CONFIG_SPARC |
3097 | hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff); | 3097 | hp->hm_revision = of_getintprop_default(dp, "hm-rev", 0xff); |
3098 | if (hp->hm_revision == 0xff) { | 3098 | if (hp->hm_revision == 0xff) |
3099 | unsigned char prev; | 3099 | hp->hm_revision = 0xc0 | (pdev->revision & 0x0f); |
3100 | |||
3101 | pci_read_config_byte(pdev, PCI_REVISION_ID, &prev); | ||
3102 | hp->hm_revision = 0xc0 | (prev & 0x0f); | ||
3103 | } | ||
3104 | #else | 3100 | #else |
3105 | /* works with this on non-sparc hosts */ | 3101 | /* works with this on non-sparc hosts */ |
3106 | hp->hm_revision = 0x20; | 3102 | hp->hm_revision = 0x20; |
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 2f3184184ad9..b148d57ec571 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c | |||
@@ -10498,11 +10498,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) | |||
10498 | continue; | 10498 | continue; |
10499 | } | 10499 | } |
10500 | if (pci_id->rev != PCI_ANY_ID) { | 10500 | if (pci_id->rev != PCI_ANY_ID) { |
10501 | u8 rev; | 10501 | if (bridge->revision > pci_id->rev) |
10502 | |||
10503 | pci_read_config_byte(bridge, PCI_REVISION_ID, | ||
10504 | &rev); | ||
10505 | if (rev > pci_id->rev) | ||
10506 | continue; | 10502 | continue; |
10507 | } | 10503 | } |
10508 | if (bridge->subordinate && | 10504 | if (bridge->subordinate && |
diff --git a/drivers/net/tlan.c b/drivers/net/tlan.c index 106dc1ef0acb..74eb12107e68 100644 --- a/drivers/net/tlan.c +++ b/drivers/net/tlan.c | |||
@@ -533,7 +533,6 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
533 | 533 | ||
534 | struct net_device *dev; | 534 | struct net_device *dev; |
535 | TLanPrivateInfo *priv; | 535 | TLanPrivateInfo *priv; |
536 | u8 pci_rev; | ||
537 | u16 device_id; | 536 | u16 device_id; |
538 | int reg, rc = -ENODEV; | 537 | int reg, rc = -ENODEV; |
539 | 538 | ||
@@ -577,8 +576,6 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
577 | goto err_out_free_dev; | 576 | goto err_out_free_dev; |
578 | } | 577 | } |
579 | 578 | ||
580 | pci_read_config_byte ( pdev, PCI_REVISION_ID, &pci_rev); | ||
581 | |||
582 | for ( reg= 0; reg <= 5; reg ++ ) { | 579 | for ( reg= 0; reg <= 5; reg ++ ) { |
583 | if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) { | 580 | if (pci_resource_flags(pdev, reg) & IORESOURCE_IO) { |
584 | pci_io_base = pci_resource_start(pdev, reg); | 581 | pci_io_base = pci_resource_start(pdev, reg); |
@@ -595,7 +592,7 @@ static int __devinit TLan_probe1(struct pci_dev *pdev, | |||
595 | 592 | ||
596 | dev->base_addr = pci_io_base; | 593 | dev->base_addr = pci_io_base; |
597 | dev->irq = pdev->irq; | 594 | dev->irq = pdev->irq; |
598 | priv->adapterRev = pci_rev; | 595 | priv->adapterRev = pdev->revision; |
599 | pci_set_master(pdev); | 596 | pci_set_master(pdev); |
600 | pci_set_drvdata(pdev, dev); | 597 | pci_set_drvdata(pdev, dev); |
601 | 598 | ||
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; |
diff --git a/drivers/net/tulip/dmfe.c b/drivers/net/tulip/dmfe.c index 4ed67ff0e81e..dab74feb44bc 100644 --- a/drivers/net/tulip/dmfe.c +++ b/drivers/net/tulip/dmfe.c | |||
@@ -181,11 +181,12 @@ | |||
181 | udelay(5); | 181 | udelay(5); |
182 | 182 | ||
183 | #define __CHK_IO_SIZE(pci_id, dev_rev) \ | 183 | #define __CHK_IO_SIZE(pci_id, dev_rev) \ |
184 | (( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x02000030) ) ? \ | 184 | (( ((pci_id)==PCI_DM9132_ID) || ((dev_rev) >= 0x30) ) ? \ |
185 | DM9102A_IO_SIZE: DM9102_IO_SIZE) | 185 | DM9102A_IO_SIZE: DM9102_IO_SIZE) |
186 | 186 | ||
187 | #define CHK_IO_SIZE(pci_dev, dev_rev) \ | 187 | #define CHK_IO_SIZE(pci_dev) \ |
188 | (__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, dev_rev)) | 188 | (__CHK_IO_SIZE(((pci_dev)->device << 16) | (pci_dev)->vendor, \ |
189 | (pci_dev)->revision)) | ||
189 | 190 | ||
190 | /* Sten Check */ | 191 | /* Sten Check */ |
191 | #define DEVICE net_device | 192 | #define DEVICE net_device |
@@ -205,7 +206,7 @@ struct rx_desc { | |||
205 | 206 | ||
206 | struct dmfe_board_info { | 207 | struct dmfe_board_info { |
207 | u32 chip_id; /* Chip vendor/Device ID */ | 208 | u32 chip_id; /* Chip vendor/Device ID */ |
208 | u32 chip_revision; /* Chip revision */ | 209 | u8 chip_revision; /* Chip revision */ |
209 | struct DEVICE *next_dev; /* next device */ | 210 | struct DEVICE *next_dev; /* next device */ |
210 | struct pci_dev *pdev; /* PCI device */ | 211 | struct pci_dev *pdev; /* PCI device */ |
211 | spinlock_t lock; | 212 | spinlock_t lock; |
@@ -359,7 +360,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
359 | { | 360 | { |
360 | struct dmfe_board_info *db; /* board information structure */ | 361 | struct dmfe_board_info *db; /* board information structure */ |
361 | struct net_device *dev; | 362 | struct net_device *dev; |
362 | u32 dev_rev, pci_pmr; | 363 | u32 pci_pmr; |
363 | int i, err; | 364 | int i, err; |
364 | 365 | ||
365 | DMFE_DBUG(0, "dmfe_init_one()", 0); | 366 | DMFE_DBUG(0, "dmfe_init_one()", 0); |
@@ -392,10 +393,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
392 | goto err_out_disable; | 393 | goto err_out_disable; |
393 | } | 394 | } |
394 | 395 | ||
395 | /* Read Chip revision */ | 396 | if (pci_resource_len(pdev, 0) < (CHK_IO_SIZE(pdev)) ) { |
396 | pci_read_config_dword(pdev, PCI_REVISION_ID, &dev_rev); | ||
397 | |||
398 | if (pci_resource_len(pdev, 0) < (CHK_IO_SIZE(pdev, dev_rev)) ) { | ||
399 | printk(KERN_ERR DRV_NAME ": Allocated I/O size too small\n"); | 397 | printk(KERN_ERR DRV_NAME ": Allocated I/O size too small\n"); |
400 | err = -ENODEV; | 398 | err = -ENODEV; |
401 | goto err_out_disable; | 399 | goto err_out_disable; |
@@ -433,7 +431,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
433 | 431 | ||
434 | db->chip_id = ent->driver_data; | 432 | db->chip_id = ent->driver_data; |
435 | db->ioaddr = pci_resource_start(pdev, 0); | 433 | db->ioaddr = pci_resource_start(pdev, 0); |
436 | db->chip_revision = dev_rev; | 434 | db->chip_revision = pdev->revision; |
437 | db->wol_mode = 0; | 435 | db->wol_mode = 0; |
438 | 436 | ||
439 | db->pdev = pdev; | 437 | db->pdev = pdev; |
@@ -455,7 +453,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, | |||
455 | 453 | ||
456 | pci_read_config_dword(pdev, 0x50, &pci_pmr); | 454 | pci_read_config_dword(pdev, 0x50, &pci_pmr); |
457 | pci_pmr &= 0x70000; | 455 | pci_pmr &= 0x70000; |
458 | if ( (pci_pmr == 0x10000) && (dev_rev == 0x02000031) ) | 456 | if ( (pci_pmr == 0x10000) && (db->chip_revision == 0x31) ) |
459 | db->chip_type = 1; /* DM9102A E3 */ | 457 | db->chip_type = 1; /* DM9102A E3 */ |
460 | else | 458 | else |
461 | db->chip_type = 0; | 459 | db->chip_type = 0; |
@@ -553,7 +551,7 @@ static int dmfe_open(struct DEVICE *dev) | |||
553 | 551 | ||
554 | /* CR6 operation mode decision */ | 552 | /* CR6 operation mode decision */ |
555 | if ( !chkmode || (db->chip_id == PCI_DM9132_ID) || | 553 | if ( !chkmode || (db->chip_id == PCI_DM9132_ID) || |
556 | (db->chip_revision >= 0x02000030) ) { | 554 | (db->chip_revision >= 0x30) ) { |
557 | db->cr6_data |= DMFE_TXTH_256; | 555 | db->cr6_data |= DMFE_TXTH_256; |
558 | db->cr0_data = CR0_DEFAULT; | 556 | db->cr0_data = CR0_DEFAULT; |
559 | db->dm910x_chk_mode=4; /* Enter the normal mode */ | 557 | db->dm910x_chk_mode=4; /* Enter the normal mode */ |
@@ -1199,9 +1197,9 @@ static void dmfe_timer(unsigned long data) | |||
1199 | tmp_cr12 = inb(db->ioaddr + DCR12); /* DM9102/DM9102A */ | 1197 | tmp_cr12 = inb(db->ioaddr + DCR12); /* DM9102/DM9102A */ |
1200 | 1198 | ||
1201 | if ( ((db->chip_id == PCI_DM9102_ID) && | 1199 | if ( ((db->chip_id == PCI_DM9102_ID) && |
1202 | (db->chip_revision == 0x02000030)) || | 1200 | (db->chip_revision == 0x30)) || |
1203 | ((db->chip_id == PCI_DM9132_ID) && | 1201 | ((db->chip_id == PCI_DM9132_ID) && |
1204 | (db->chip_revision == 0x02000010)) ) { | 1202 | (db->chip_revision == 0x10)) ) { |
1205 | /* DM9102A Chip */ | 1203 | /* DM9102A Chip */ |
1206 | if (tmp_cr12 & 2) | 1204 | if (tmp_cr12 & 2) |
1207 | link_ok = 0; | 1205 | link_ok = 0; |
diff --git a/drivers/net/tulip/tulip_core.c b/drivers/net/tulip/tulip_core.c index 041af63f2811..1a9e911b86a2 100644 --- a/drivers/net/tulip/tulip_core.c +++ b/drivers/net/tulip/tulip_core.c | |||
@@ -1238,7 +1238,6 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1238 | }; | 1238 | }; |
1239 | static int last_irq; | 1239 | static int last_irq; |
1240 | static int multiport_cnt; /* For four-port boards w/one EEPROM */ | 1240 | static int multiport_cnt; /* For four-port boards w/one EEPROM */ |
1241 | u8 chip_rev; | ||
1242 | int i, irq; | 1241 | int i, irq; |
1243 | unsigned short sum; | 1242 | unsigned short sum; |
1244 | unsigned char *ee_data; | 1243 | unsigned char *ee_data; |
@@ -1274,10 +1273,8 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1274 | 1273 | ||
1275 | if (pdev->vendor == 0x1282 && pdev->device == 0x9100) | 1274 | if (pdev->vendor == 0x1282 && pdev->device == 0x9100) |
1276 | { | 1275 | { |
1277 | u32 dev_rev; | ||
1278 | /* Read Chip revision */ | 1276 | /* Read Chip revision */ |
1279 | pci_read_config_dword(pdev, PCI_REVISION_ID, &dev_rev); | 1277 | if (pdev->revision < 0x02000030) |
1280 | if(dev_rev < 0x02000030) | ||
1281 | { | 1278 | { |
1282 | printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); | 1279 | printk(KERN_ERR PFX "skipping early DM9100 with Crc bug (use dmfe)\n"); |
1283 | return -ENODEV; | 1280 | return -ENODEV; |
@@ -1360,8 +1357,6 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1360 | if (!ioaddr) | 1357 | if (!ioaddr) |
1361 | goto err_out_free_res; | 1358 | goto err_out_free_res; |
1362 | 1359 | ||
1363 | pci_read_config_byte (pdev, PCI_REVISION_ID, &chip_rev); | ||
1364 | |||
1365 | /* | 1360 | /* |
1366 | * initialize private data structure 'tp' | 1361 | * initialize private data structure 'tp' |
1367 | * it is zeroed and aligned in alloc_etherdev | 1362 | * it is zeroed and aligned in alloc_etherdev |
@@ -1382,7 +1377,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1382 | tp->flags = tulip_tbl[chip_idx].flags; | 1377 | tp->flags = tulip_tbl[chip_idx].flags; |
1383 | tp->pdev = pdev; | 1378 | tp->pdev = pdev; |
1384 | tp->base_addr = ioaddr; | 1379 | tp->base_addr = ioaddr; |
1385 | tp->revision = chip_rev; | 1380 | tp->revision = pdev->revision; |
1386 | tp->csr0 = csr0; | 1381 | tp->csr0 = csr0; |
1387 | spin_lock_init(&tp->lock); | 1382 | spin_lock_init(&tp->lock); |
1388 | spin_lock_init(&tp->mii_lock); | 1383 | spin_lock_init(&tp->mii_lock); |
@@ -1399,7 +1394,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1399 | tulip_mwi_config (pdev, dev); | 1394 | tulip_mwi_config (pdev, dev); |
1400 | #else | 1395 | #else |
1401 | /* MWI is broken for DC21143 rev 65... */ | 1396 | /* MWI is broken for DC21143 rev 65... */ |
1402 | if (chip_idx == DC21143 && chip_rev == 65) | 1397 | if (chip_idx == DC21143 && pdev->revision == 65) |
1403 | tp->csr0 &= ~MWI; | 1398 | tp->csr0 &= ~MWI; |
1404 | #endif | 1399 | #endif |
1405 | 1400 | ||
@@ -1640,7 +1635,7 @@ static int __devinit tulip_init_one (struct pci_dev *pdev, | |||
1640 | #else | 1635 | #else |
1641 | "Port" | 1636 | "Port" |
1642 | #endif | 1637 | #endif |
1643 | " %#llx,", dev->name, chip_name, chip_rev, | 1638 | " %#llx,", dev->name, chip_name, pdev->revision, |
1644 | (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); | 1639 | (unsigned long long) pci_resource_start(pdev, TULIP_BAR)); |
1645 | pci_set_drvdata(pdev, dev); | 1640 | pci_set_drvdata(pdev, dev); |
1646 | 1641 | ||
diff --git a/drivers/net/tulip/xircom_cb.c b/drivers/net/tulip/xircom_cb.c index 2470b1ee33c0..79943cdd6337 100644 --- a/drivers/net/tulip/xircom_cb.c +++ b/drivers/net/tulip/xircom_cb.c | |||
@@ -205,7 +205,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
205 | { | 205 | { |
206 | struct net_device *dev = NULL; | 206 | struct net_device *dev = NULL; |
207 | struct xircom_private *private; | 207 | struct xircom_private *private; |
208 | unsigned char chip_rev; | ||
209 | unsigned long flags; | 208 | unsigned long flags; |
210 | unsigned short tmp16; | 209 | unsigned short tmp16; |
211 | enter("xircom_probe"); | 210 | enter("xircom_probe"); |
@@ -224,8 +223,6 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
224 | pci_read_config_word (pdev,PCI_STATUS, &tmp16); | 223 | pci_read_config_word (pdev,PCI_STATUS, &tmp16); |
225 | pci_write_config_word (pdev, PCI_STATUS,tmp16); | 224 | pci_write_config_word (pdev, PCI_STATUS,tmp16); |
226 | 225 | ||
227 | pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev); | ||
228 | |||
229 | if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) { | 226 | if (!request_region(pci_resource_start(pdev, 0), 128, "xircom_cb")) { |
230 | printk(KERN_ERR "xircom_probe: failed to allocate io-region\n"); | 227 | printk(KERN_ERR "xircom_probe: failed to allocate io-region\n"); |
231 | return -ENODEV; | 228 | return -ENODEV; |
@@ -286,7 +283,7 @@ static int __devinit xircom_probe(struct pci_dev *pdev, const struct pci_device_ | |||
286 | goto reg_fail; | 283 | goto reg_fail; |
287 | } | 284 | } |
288 | 285 | ||
289 | printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, chip_rev, pdev->irq); | 286 | printk(KERN_INFO "%s: Xircom cardbus revision %i at irq %i \n", dev->name, pdev->revision, pdev->irq); |
290 | /* start the transmitter to get a heartbeat */ | 287 | /* start the transmitter to get a heartbeat */ |
291 | /* TODO: send 2 dummy packets here */ | 288 | /* TODO: send 2 dummy packets here */ |
292 | transceiver_voodoo(private); | 289 | transceiver_voodoo(private); |
diff --git a/drivers/net/tulip/xircom_tulip_cb.c b/drivers/net/tulip/xircom_tulip_cb.c index f64172927377..83d69f11892f 100644 --- a/drivers/net/tulip/xircom_tulip_cb.c +++ b/drivers/net/tulip/xircom_tulip_cb.c | |||
@@ -524,7 +524,6 @@ static int __devinit xircom_init_one(struct pci_dev *pdev, const struct pci_devi | |||
524 | int chip_idx = id->driver_data; | 524 | int chip_idx = id->driver_data; |
525 | long ioaddr; | 525 | long ioaddr; |
526 | int i; | 526 | int i; |
527 | u8 chip_rev; | ||
528 | 527 | ||
529 | /* when built into the kernel, we only print version if device is found */ | 528 | /* when built into the kernel, we only print version if device is found */ |
530 | #ifndef MODULE | 529 | #ifndef MODULE |
@@ -620,9 +619,8 @@ static int __devinit xircom_init_one(struct pci_dev *pdev, const struct pci_devi | |||
620 | if (register_netdev(dev)) | 619 | if (register_netdev(dev)) |
621 | goto err_out_cleardev; | 620 | goto err_out_cleardev; |
622 | 621 | ||
623 | pci_read_config_byte(pdev, PCI_REVISION_ID, &chip_rev); | ||
624 | printk(KERN_INFO "%s: %s rev %d at %#3lx,", | 622 | printk(KERN_INFO "%s: %s rev %d at %#3lx,", |
625 | dev->name, xircom_tbl[chip_idx].chip_name, chip_rev, ioaddr); | 623 | dev->name, xircom_tbl[chip_idx].chip_name, pdev->revision, ioaddr); |
626 | for (i = 0; i < 6; i++) | 624 | for (i = 0; i < 6; i++) |
627 | printk("%c%2.2X", i ? ':' : ' ', dev->dev_addr[i]); | 625 | printk("%c%2.2X", i ? ':' : ' ', dev->dev_addr[i]); |
628 | printk(", IRQ %d.\n", dev->irq); | 626 | printk(", IRQ %d.\n", dev->irq); |
diff --git a/drivers/net/via-rhine.c b/drivers/net/via-rhine.c index adea290a9d5e..73e9c3dcddde 100644 --- a/drivers/net/via-rhine.c +++ b/drivers/net/via-rhine.c | |||
@@ -622,7 +622,6 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
622 | struct net_device *dev; | 622 | struct net_device *dev; |
623 | struct rhine_private *rp; | 623 | struct rhine_private *rp; |
624 | int i, rc; | 624 | int i, rc; |
625 | u8 pci_rev; | ||
626 | u32 quirks; | 625 | u32 quirks; |
627 | long pioaddr; | 626 | long pioaddr; |
628 | long memaddr; | 627 | long memaddr; |
@@ -642,27 +641,25 @@ static int __devinit rhine_init_one(struct pci_dev *pdev, | |||
642 | printk(version); | 641 | printk(version); |
643 | #endif | 642 | #endif |
644 | 643 | ||
645 | pci_read_config_byte(pdev, PCI_REVISION_ID, &pci_rev); | ||
646 | |||
647 | io_size = 256; | 644 | io_size = 256; |
648 | phy_id = 0; | 645 | phy_id = 0; |
649 | quirks = 0; | 646 | quirks = 0; |
650 | name = "Rhine"; | 647 | name = "Rhine"; |
651 | if (pci_rev < VTunknown0) { | 648 | if (pdev->revision < VTunknown0) { |
652 | quirks = rqRhineI; | 649 | quirks = rqRhineI; |
653 | io_size = 128; | 650 | io_size = 128; |
654 | } | 651 | } |
655 | else if (pci_rev >= VT6102) { | 652 | else if (pdev->revision >= VT6102) { |
656 | quirks = rqWOL | rqForceReset; | 653 | quirks = rqWOL | rqForceReset; |
657 | if (pci_rev < VT6105) { | 654 | if (pdev->revision < VT6105) { |
658 | name = "Rhine II"; | 655 | name = "Rhine II"; |
659 | quirks |= rqStatusWBRace; /* Rhine-II exclusive */ | 656 | quirks |= rqStatusWBRace; /* Rhine-II exclusive */ |
660 | } | 657 | } |
661 | else { | 658 | else { |
662 | phy_id = 1; /* Integrated PHY, phy_id fixed to 1 */ | 659 | phy_id = 1; /* Integrated PHY, phy_id fixed to 1 */ |
663 | if (pci_rev >= VT6105_B0) | 660 | if (pdev->revision >= VT6105_B0) |
664 | quirks |= rq6patterns; | 661 | quirks |= rq6patterns; |
665 | if (pci_rev < VT6105M) | 662 | if (pdev->revision < VT6105M) |
666 | name = "Rhine III"; | 663 | name = "Rhine III"; |
667 | else | 664 | else |
668 | name = "Rhine III (Management Adapter)"; | 665 | name = "Rhine III (Management Adapter)"; |
diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index b670b97bcfde..f331843d1102 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c | |||
@@ -890,8 +890,7 @@ static void __devinit velocity_init_info(struct pci_dev *pdev, | |||
890 | 890 | ||
891 | static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pci_dev *pdev) | 891 | static int __devinit velocity_get_pci_info(struct velocity_info *vptr, struct pci_dev *pdev) |
892 | { | 892 | { |
893 | if (pci_read_config_byte(pdev, PCI_REVISION_ID, &vptr->rev_id) < 0) | 893 | vptr->rev_id = pdev->revision; |
894 | return -EIO; | ||
895 | 894 | ||
896 | pci_set_master(pdev); | 895 | pci_set_master(pdev); |
897 | 896 | ||
diff --git a/drivers/net/wan/pc300_drv.c b/drivers/net/wan/pc300_drv.c index 999bf71937ca..ec1c556a47ca 100644 --- a/drivers/net/wan/pc300_drv.c +++ b/drivers/net/wan/pc300_drv.c | |||
@@ -3439,7 +3439,6 @@ static int __devinit | |||
3439 | cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | 3439 | cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) |
3440 | { | 3440 | { |
3441 | static int first_time = 1; | 3441 | static int first_time = 1; |
3442 | ucchar cpc_rev_id; | ||
3443 | int err, eeprom_outdated = 0; | 3442 | int err, eeprom_outdated = 0; |
3444 | ucshort device_id; | 3443 | ucshort device_id; |
3445 | pc300_t *card; | 3444 | pc300_t *card; |
@@ -3480,7 +3479,6 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3480 | card->hw.falcsize = pci_resource_len(pdev, 4); | 3479 | card->hw.falcsize = pci_resource_len(pdev, 4); |
3481 | card->hw.plxphys = pci_resource_start(pdev, 5); | 3480 | card->hw.plxphys = pci_resource_start(pdev, 5); |
3482 | card->hw.plxsize = pci_resource_len(pdev, 5); | 3481 | card->hw.plxsize = pci_resource_len(pdev, 5); |
3483 | pci_read_config_byte(pdev, PCI_REVISION_ID, &cpc_rev_id); | ||
3484 | 3482 | ||
3485 | switch (device_id) { | 3483 | switch (device_id) { |
3486 | case PCI_DEVICE_ID_PC300_RX_1: | 3484 | case PCI_DEVICE_ID_PC300_RX_1: |
@@ -3498,7 +3496,7 @@ cpc_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
3498 | } | 3496 | } |
3499 | #ifdef PC300_DEBUG_PCI | 3497 | #ifdef PC300_DEBUG_PCI |
3500 | printk("cpc (bus=0x0%x,pci_id=0x%x,", pdev->bus->number, pdev->devfn); | 3498 | printk("cpc (bus=0x0%x,pci_id=0x%x,", pdev->bus->number, pdev->devfn); |
3501 | printk("rev_id=%d) IRQ%d\n", cpc_rev_id, card->hw.irq); | 3499 | printk("rev_id=%d) IRQ%d\n", pdev->revision, card->hw.irq); |
3502 | printk("cpc:found ramaddr=0x%08lx plxaddr=0x%08lx " | 3500 | printk("cpc:found ramaddr=0x%08lx plxaddr=0x%08lx " |
3503 | "ctladdr=0x%08lx falcaddr=0x%08lx\n", | 3501 | "ctladdr=0x%08lx falcaddr=0x%08lx\n", |
3504 | card->hw.ramphys, card->hw.plxphys, card->hw.scaphys, | 3502 | card->hw.ramphys, card->hw.plxphys, card->hw.scaphys, |
diff --git a/drivers/net/wan/pc300too.c b/drivers/net/wan/pc300too.c index aff05dba720a..dfbd3b00f03b 100644 --- a/drivers/net/wan/pc300too.c +++ b/drivers/net/wan/pc300too.c | |||
@@ -311,7 +311,6 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, | |||
311 | const struct pci_device_id *ent) | 311 | const struct pci_device_id *ent) |
312 | { | 312 | { |
313 | card_t *card; | 313 | card_t *card; |
314 | u8 rev_id; | ||
315 | u32 __iomem *p; | 314 | u32 __iomem *p; |
316 | int i; | 315 | int i; |
317 | u32 ramsize; | 316 | u32 ramsize; |
@@ -366,7 +365,6 @@ static int __devinit pc300_pci_init_one(struct pci_dev *pdev, | |||
366 | return -ENOMEM; | 365 | return -ENOMEM; |
367 | } | 366 | } |
368 | 367 | ||
369 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | ||
370 | if (pci_resource_len(pdev, 0) != PC300_PLX_SIZE || | 368 | if (pci_resource_len(pdev, 0) != PC300_PLX_SIZE || |
371 | pci_resource_len(pdev, 2) != PC300_SCA_SIZE || | 369 | pci_resource_len(pdev, 2) != PC300_SCA_SIZE || |
372 | pci_resource_len(pdev, 3) < 16384) { | 370 | pci_resource_len(pdev, 3) < 16384) { |
diff --git a/drivers/net/wan/pci200syn.c b/drivers/net/wan/pci200syn.c index ca06a00d9d86..7f720de2e9f0 100644 --- a/drivers/net/wan/pci200syn.c +++ b/drivers/net/wan/pci200syn.c | |||
@@ -289,7 +289,6 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, | |||
289 | const struct pci_device_id *ent) | 289 | const struct pci_device_id *ent) |
290 | { | 290 | { |
291 | card_t *card; | 291 | card_t *card; |
292 | u8 rev_id; | ||
293 | u32 __iomem *p; | 292 | u32 __iomem *p; |
294 | int i; | 293 | int i; |
295 | u32 ramsize; | 294 | u32 ramsize; |
@@ -330,7 +329,6 @@ static int __devinit pci200_pci_init_one(struct pci_dev *pdev, | |||
330 | return -ENOMEM; | 329 | return -ENOMEM; |
331 | } | 330 | } |
332 | 331 | ||
333 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id); | ||
334 | if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || | 332 | if (pci_resource_len(pdev, 0) != PCI200SYN_PLX_SIZE || |
335 | pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || | 333 | pci_resource_len(pdev, 2) != PCI200SYN_SCA_SIZE || |
336 | pci_resource_len(pdev, 3) < 16384) { | 334 | pci_resource_len(pdev, 3) < 16384) { |
diff --git a/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/drivers/net/wireless/bcm43xx/bcm43xx_main.c index ef6b253a92ce..c5d6753a55ea 100644 --- a/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/drivers/net/wireless/bcm43xx/bcm43xx_main.c | |||
@@ -3741,10 +3741,8 @@ static int bcm43xx_attach_board(struct bcm43xx_private *bcm) | |||
3741 | &bcm->board_type); | 3741 | &bcm->board_type); |
3742 | if (err) | 3742 | if (err) |
3743 | goto err_iounmap; | 3743 | goto err_iounmap; |
3744 | err = bcm43xx_pci_read_config16(bcm, PCI_REVISION_ID, | 3744 | |
3745 | &bcm->board_revision); | 3745 | bcm->board_revision = bcm->pci_dev->revision; |
3746 | if (err) | ||
3747 | goto err_iounmap; | ||
3748 | 3746 | ||
3749 | err = bcm43xx_chipset_attach(bcm); | 3747 | err = bcm43xx_chipset_attach(bcm); |
3750 | if (err) | 3748 | if (err) |
diff --git a/drivers/pci/hotplug/cpqphp_core.c b/drivers/pci/hotplug/cpqphp_core.c index 5617cfdadc5c..d590a99930fa 100644 --- a/drivers/pci/hotplug/cpqphp_core.c +++ b/drivers/pci/hotplug/cpqphp_core.c | |||
@@ -796,7 +796,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
796 | u8 num_of_slots = 0; | 796 | u8 num_of_slots = 0; |
797 | u8 hp_slot = 0; | 797 | u8 hp_slot = 0; |
798 | u8 device; | 798 | u8 device; |
799 | u8 rev; | ||
800 | u8 bus_cap; | 799 | u8 bus_cap; |
801 | u16 temp_word; | 800 | u16 temp_word; |
802 | u16 vendor_id; | 801 | u16 vendor_id; |
@@ -823,9 +822,8 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
823 | } | 822 | } |
824 | dbg("Vendor ID: %x\n", vendor_id); | 823 | dbg("Vendor ID: %x\n", vendor_id); |
825 | 824 | ||
826 | rc = pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | 825 | dbg("revision: %d\n", pdev->revision); |
827 | dbg("revision: %d\n", rev); | 826 | if ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!pdev->revision)) { |
828 | if (rc || ((vendor_id == PCI_VENDOR_ID_COMPAQ) && (!rev))) { | ||
829 | err(msg_HPC_rev_error); | 827 | err(msg_HPC_rev_error); |
830 | rc = -ENODEV; | 828 | rc = -ENODEV; |
831 | goto err_disable_device; | 829 | goto err_disable_device; |
@@ -836,7 +834,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
836 | * For Intel, each SSID bit identifies a PHP capability. | 834 | * For Intel, each SSID bit identifies a PHP capability. |
837 | * Also Intel HPC's may have RID=0. | 835 | * Also Intel HPC's may have RID=0. |
838 | */ | 836 | */ |
839 | if ((rev > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) { | 837 | if ((pdev->revision > 2) || (vendor_id == PCI_VENDOR_ID_INTEL)) { |
840 | // TODO: This code can be made to support non-Compaq or Intel subsystem IDs | 838 | // TODO: This code can be made to support non-Compaq or Intel subsystem IDs |
841 | rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); | 839 | rc = pci_read_config_word(pdev, PCI_SUBSYSTEM_VENDOR_ID, &subsystem_vid); |
842 | if (rc) { | 840 | if (rc) { |
@@ -870,7 +868,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
870 | 868 | ||
871 | switch (subsystem_vid) { | 869 | switch (subsystem_vid) { |
872 | case PCI_VENDOR_ID_COMPAQ: | 870 | case PCI_VENDOR_ID_COMPAQ: |
873 | if (rev >= 0x13) { /* CIOBX */ | 871 | if (pdev->revision >= 0x13) { /* CIOBX */ |
874 | ctrl->push_flag = 1; | 872 | ctrl->push_flag = 1; |
875 | ctrl->slot_switch_type = 1; | 873 | ctrl->slot_switch_type = 1; |
876 | ctrl->push_button = 1; | 874 | ctrl->push_button = 1; |
@@ -1075,7 +1073,7 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
1075 | memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus)); | 1073 | memcpy(ctrl->pci_bus, pdev->bus, sizeof(*ctrl->pci_bus)); |
1076 | 1074 | ||
1077 | ctrl->bus = pdev->bus->number; | 1075 | ctrl->bus = pdev->bus->number; |
1078 | ctrl->rev = rev; | 1076 | ctrl->rev = pdev->revision; |
1079 | dbg("bus device function rev: %d %d %d %d\n", ctrl->bus, | 1077 | dbg("bus device function rev: %d %d %d %d\n", ctrl->bus, |
1080 | PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); | 1078 | PCI_SLOT(pdev->devfn), PCI_FUNC(pdev->devfn), ctrl->rev); |
1081 | 1079 | ||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index 75bd6a8648f6..f75ade6f0602 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -587,10 +587,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8237, quirk_via_v | |||
587 | */ | 587 | */ |
588 | static void __devinit quirk_amd_ioapic(struct pci_dev *dev) | 588 | static void __devinit quirk_amd_ioapic(struct pci_dev *dev) |
589 | { | 589 | { |
590 | u8 rev; | 590 | if (dev->revision >= 0x02) { |
591 | |||
592 | pci_read_config_byte(dev, PCI_REVISION_ID, &rev); | ||
593 | if (rev >= 0x02) { | ||
594 | printk(KERN_WARNING "I/O APIC: AMD Erratum #22 may be present. In the event of instability try\n"); | 591 | printk(KERN_WARNING "I/O APIC: AMD Erratum #22 may be present. In the event of instability try\n"); |
595 | printk(KERN_WARNING " : booting with the \"noapic\" option.\n"); | 592 | printk(KERN_WARNING " : booting with the \"noapic\" option.\n"); |
596 | } | 593 | } |
@@ -610,13 +607,12 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SI, PCI_ANY_ID, quirk_ioapic_rmw ); | |||
610 | #define AMD8131_NIOAMODE_BIT 0 | 607 | #define AMD8131_NIOAMODE_BIT 0 |
611 | static void quirk_amd_8131_ioapic(struct pci_dev *dev) | 608 | static void quirk_amd_8131_ioapic(struct pci_dev *dev) |
612 | { | 609 | { |
613 | unsigned char revid, tmp; | 610 | unsigned char tmp; |
614 | 611 | ||
615 | if (nr_ioapics == 0) | 612 | if (nr_ioapics == 0) |
616 | return; | 613 | return; |
617 | 614 | ||
618 | pci_read_config_byte(dev, PCI_REVISION_ID, &revid); | 615 | if (dev->revision == AMD8131_revA0 || dev->revision == AMD8131_revB0) { |
619 | if (revid == AMD8131_revA0 || revid == AMD8131_revB0) { | ||
620 | printk(KERN_INFO "Fixing up AMD8131 IOAPIC mode\n"); | 616 | printk(KERN_INFO "Fixing up AMD8131 IOAPIC mode\n"); |
621 | pci_read_config_byte( dev, AMD8131_MISC, &tmp); | 617 | pci_read_config_byte( dev, AMD8131_MISC, &tmp); |
622 | tmp &= ~(1 << AMD8131_NIOAMODE_BIT); | 618 | tmp &= ~(1 << AMD8131_NIOAMODE_BIT); |
@@ -859,10 +855,8 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_PCI_MASTER, qu | |||
859 | static void quirk_disable_pxb(struct pci_dev *pdev) | 855 | static void quirk_disable_pxb(struct pci_dev *pdev) |
860 | { | 856 | { |
861 | u16 config; | 857 | u16 config; |
862 | u8 rev; | ||
863 | 858 | ||
864 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | 859 | if (pdev->revision != 0x04) /* Only C0 requires this */ |
865 | if (rev != 0x04) /* Only C0 requires this */ | ||
866 | return; | 860 | return; |
867 | pci_read_config_word(pdev, 0x40, &config); | 861 | pci_read_config_word(pdev, 0x40, &config); |
868 | if (config & (1<<6)) { | 862 | if (config & (1<<6)) { |
diff --git a/drivers/scsi/aic94xx/aic94xx_init.c b/drivers/scsi/aic94xx/aic94xx_init.c index 27852b43b904..1c0d7578e791 100644 --- a/drivers/scsi/aic94xx/aic94xx_init.c +++ b/drivers/scsi/aic94xx/aic94xx_init.c | |||
@@ -223,13 +223,8 @@ static int __devinit asd_common_setup(struct asd_ha_struct *asd_ha) | |||
223 | { | 223 | { |
224 | int err, i; | 224 | int err, i; |
225 | 225 | ||
226 | err = pci_read_config_byte(asd_ha->pcidev, PCI_REVISION_ID, | 226 | asd_ha->revision_id = asd_ha->pcidev->revision; |
227 | &asd_ha->revision_id); | 227 | |
228 | if (err) { | ||
229 | asd_printk("couldn't read REVISION ID register of %s\n", | ||
230 | pci_name(asd_ha->pcidev)); | ||
231 | goto Err; | ||
232 | } | ||
233 | err = -ENODEV; | 228 | err = -ENODEV; |
234 | if (asd_ha->revision_id < AIC9410_DEV_REV_B0) { | 229 | if (asd_ha->revision_id < AIC9410_DEV_REV_B0) { |
235 | asd_printk("%s is revision %s (%X), which is not supported\n", | 230 | asd_printk("%s is revision %s (%X), which is not supported\n", |
diff --git a/drivers/scsi/ipr.c b/drivers/scsi/ipr.c index fa6ff295e568..81330712048c 100644 --- a/drivers/scsi/ipr.c +++ b/drivers/scsi/ipr.c | |||
@@ -5367,18 +5367,12 @@ static const u16 ipr_blocked_processors[] = { | |||
5367 | **/ | 5367 | **/ |
5368 | static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg) | 5368 | static int ipr_invalid_adapter(struct ipr_ioa_cfg *ioa_cfg) |
5369 | { | 5369 | { |
5370 | u8 rev_id; | ||
5371 | int i; | 5370 | int i; |
5372 | 5371 | ||
5373 | if (ioa_cfg->type == 0x5702) { | 5372 | if ((ioa_cfg->type == 0x5702) && (ioa_cfg->pdev->revision < 4)) { |
5374 | if (pci_read_config_byte(ioa_cfg->pdev, PCI_REVISION_ID, | 5373 | for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){ |
5375 | &rev_id) == PCIBIOS_SUCCESSFUL) { | 5374 | if (__is_processor(ipr_blocked_processors[i])) |
5376 | if (rev_id < 4) { | 5375 | return 1; |
5377 | for (i = 0; i < ARRAY_SIZE(ipr_blocked_processors); i++){ | ||
5378 | if (__is_processor(ipr_blocked_processors[i])) | ||
5379 | return 1; | ||
5380 | } | ||
5381 | } | ||
5382 | } | 5376 | } |
5383 | } | 5377 | } |
5384 | return 0; | 5378 | return 0; |
@@ -7535,13 +7529,7 @@ static int __devinit ipr_probe_ioa(struct pci_dev *pdev, | |||
7535 | else | 7529 | else |
7536 | ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT; | 7530 | ioa_cfg->transop_timeout = IPR_OPERATIONAL_TIMEOUT; |
7537 | 7531 | ||
7538 | rc = pci_read_config_byte(pdev, PCI_REVISION_ID, &ioa_cfg->revid); | 7532 | ioa_cfg->revid = pdev->revision; |
7539 | |||
7540 | if (rc != PCIBIOS_SUCCESSFUL) { | ||
7541 | dev_err(&pdev->dev, "Failed to read PCI revision ID\n"); | ||
7542 | rc = -EIO; | ||
7543 | goto out_scsi_host_put; | ||
7544 | } | ||
7545 | 7533 | ||
7546 | ipr_regs_pci = pci_resource_start(pdev, 0); | 7534 | ipr_regs_pci = pci_resource_start(pdev, 0); |
7547 | 7535 | ||
diff --git a/drivers/scsi/ips.c b/drivers/scsi/ips.c index 8b704f73055a..40f148e0833f 100644 --- a/drivers/scsi/ips.c +++ b/drivers/scsi/ips.c | |||
@@ -7148,7 +7148,6 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) | |||
7148 | uint32_t mem_addr; | 7148 | uint32_t mem_addr; |
7149 | uint32_t io_len; | 7149 | uint32_t io_len; |
7150 | uint32_t mem_len; | 7150 | uint32_t mem_len; |
7151 | uint8_t revision_id; | ||
7152 | uint8_t bus; | 7151 | uint8_t bus; |
7153 | uint8_t func; | 7152 | uint8_t func; |
7154 | uint8_t irq; | 7153 | uint8_t irq; |
@@ -7227,12 +7226,6 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) | |||
7227 | } | 7226 | } |
7228 | } | 7227 | } |
7229 | 7228 | ||
7230 | /* get the revision ID */ | ||
7231 | if (pci_read_config_byte(pci_dev, PCI_REVISION_ID, &revision_id)) { | ||
7232 | IPS_PRINTK(KERN_WARNING, pci_dev, "Can't get revision id.\n"); | ||
7233 | return -1; | ||
7234 | } | ||
7235 | |||
7236 | subdevice_id = pci_dev->subsystem_device; | 7229 | subdevice_id = pci_dev->subsystem_device; |
7237 | 7230 | ||
7238 | /* found a controller */ | 7231 | /* found a controller */ |
@@ -7258,7 +7251,7 @@ ips_init_phase1(struct pci_dev *pci_dev, int *indexPtr) | |||
7258 | ha->mem_ptr = mem_ptr; | 7251 | ha->mem_ptr = mem_ptr; |
7259 | ha->ioremap_ptr = ioremap_ptr; | 7252 | ha->ioremap_ptr = ioremap_ptr; |
7260 | ha->host_num = (uint32_t) index; | 7253 | ha->host_num = (uint32_t) index; |
7261 | ha->revision_id = revision_id; | 7254 | ha->revision_id = pci_dev->revision; |
7262 | ha->slot_num = PCI_SLOT(pci_dev->devfn); | 7255 | ha->slot_num = PCI_SLOT(pci_dev->devfn); |
7263 | ha->device_id = pci_dev->device; | 7256 | ha->device_id = pci_dev->device; |
7264 | ha->subdevice_id = subdevice_id; | 7257 | ha->subdevice_id = subdevice_id; |
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 2a45aec4ff29..cf94f8636ba5 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c | |||
@@ -296,7 +296,7 @@ qla24xx_pci_config(scsi_qla_host_t *ha) | |||
296 | d &= ~PCI_ROM_ADDRESS_ENABLE; | 296 | d &= ~PCI_ROM_ADDRESS_ENABLE; |
297 | pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d); | 297 | pci_write_config_dword(ha->pdev, PCI_ROM_ADDRESS, d); |
298 | 298 | ||
299 | pci_read_config_word(ha->pdev, PCI_REVISION_ID, &ha->chip_revision); | 299 | ha->chip_revision = ha->pdev->revision; |
300 | 300 | ||
301 | /* Get PCI bus information. */ | 301 | /* Get PCI bus information. */ |
302 | spin_lock_irqsave(&ha->hardware_lock, flags); | 302 | spin_lock_irqsave(&ha->hardware_lock, flags); |
diff --git a/drivers/serial/jsm/jsm_driver.c b/drivers/serial/jsm/jsm_driver.c index 81792e6eeb2d..6767ee381cd1 100644 --- a/drivers/serial/jsm/jsm_driver.c +++ b/drivers/serial/jsm/jsm_driver.c | |||
@@ -88,7 +88,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
88 | spin_lock_init(&brd->bd_intr_lock); | 88 | spin_lock_init(&brd->bd_intr_lock); |
89 | 89 | ||
90 | /* store which revision we have */ | 90 | /* store which revision we have */ |
91 | pci_read_config_byte(pdev, PCI_REVISION_ID, &brd->rev); | 91 | brd->rev = pdev->revision; |
92 | 92 | ||
93 | brd->irq = pdev->irq; | 93 | brd->irq = pdev->irq; |
94 | 94 | ||
diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c index 12edc723ec73..966965f72338 100644 --- a/drivers/usb/host/ehci-pci.c +++ b/drivers/usb/host/ehci-pci.c | |||
@@ -149,8 +149,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd) | |||
149 | * fixed in newer silicon. | 149 | * fixed in newer silicon. |
150 | */ | 150 | */ |
151 | case 0x0068: | 151 | case 0x0068: |
152 | pci_read_config_dword(pdev, PCI_REVISION_ID, &temp); | 152 | if (pdev->revision < 0xa4) |
153 | if ((temp & 0xff) < 0xa4) | ||
154 | ehci->no_selective_suspend = 1; | 153 | ehci->no_selective_suspend = 1; |
155 | break; | 154 | break; |
156 | } | 155 | } |
diff --git a/drivers/video/kyro/STG4000InitDevice.c b/drivers/video/kyro/STG4000InitDevice.c index ab5285a7f1d6..1d3f2080aa6f 100644 --- a/drivers/video/kyro/STG4000InitDevice.c +++ b/drivers/video/kyro/STG4000InitDevice.c | |||
@@ -247,7 +247,6 @@ int SetCoreClockPLL(volatile STG4000REG __iomem *pSTGReg, struct pci_dev *pDev) | |||
247 | u32 ulCoreClock; | 247 | u32 ulCoreClock; |
248 | u32 tmp; | 248 | u32 tmp; |
249 | u32 ulChipSpeed; | 249 | u32 ulChipSpeed; |
250 | u8 rev; | ||
251 | 250 | ||
252 | STG_WRITE_REG(IntMask, 0xFFFF); | 251 | STG_WRITE_REG(IntMask, 0xFFFF); |
253 | 252 | ||
@@ -276,9 +275,9 @@ int SetCoreClockPLL(volatile STG4000REG __iomem *pSTGReg, struct pci_dev *pDev) | |||
276 | PMX2_SOFTRESET_ROM_RST); | 275 | PMX2_SOFTRESET_ROM_RST); |
277 | 276 | ||
278 | pci_read_config_word(pDev, PCI_CONFIG_SUBSYS_ID, &sub); | 277 | pci_read_config_word(pDev, PCI_CONFIG_SUBSYS_ID, &sub); |
279 | pci_read_config_byte(pDev, PCI_REVISION_ID, &rev); | ||
280 | 278 | ||
281 | ulChipSpeed = InitSDRAMRegisters(pSTGReg, (u32)sub, (u32)rev); | 279 | ulChipSpeed = InitSDRAMRegisters(pSTGReg, (u32)sub, |
280 | (u32)pDev->revision); | ||
282 | 281 | ||
283 | if (ulChipSpeed == 0) | 282 | if (ulChipSpeed == 0) |
284 | return -EINVAL; | 283 | return -EINVAL; |
diff --git a/drivers/video/matrox/matroxfb_base.c b/drivers/video/matrox/matroxfb_base.c index c8559a756b75..886e475f22f2 100644 --- a/drivers/video/matrox/matroxfb_base.c +++ b/drivers/video/matrox/matroxfb_base.c | |||
@@ -1994,7 +1994,6 @@ static void matroxfb_unregister_device(struct matrox_fb_info* minfo) { | |||
1994 | 1994 | ||
1995 | static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dummy) { | 1995 | static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dummy) { |
1996 | struct board* b; | 1996 | struct board* b; |
1997 | u_int8_t rev; | ||
1998 | u_int16_t svid; | 1997 | u_int16_t svid; |
1999 | u_int16_t sid; | 1998 | u_int16_t sid; |
2000 | struct matrox_fb_info* minfo; | 1999 | struct matrox_fb_info* minfo; |
@@ -2005,11 +2004,10 @@ static int matroxfb_probe(struct pci_dev* pdev, const struct pci_device_id* dumm | |||
2005 | #endif | 2004 | #endif |
2006 | DBG(__FUNCTION__) | 2005 | DBG(__FUNCTION__) |
2007 | 2006 | ||
2008 | pci_read_config_byte(pdev, PCI_REVISION_ID, &rev); | ||
2009 | svid = pdev->subsystem_vendor; | 2007 | svid = pdev->subsystem_vendor; |
2010 | sid = pdev->subsystem_device; | 2008 | sid = pdev->subsystem_device; |
2011 | for (b = dev_list; b->vendor; b++) { | 2009 | for (b = dev_list; b->vendor; b++) { |
2012 | if ((b->vendor != pdev->vendor) || (b->device != pdev->device) || (b->rev < rev)) continue; | 2010 | if ((b->vendor != pdev->vendor) || (b->device != pdev->device) || (b->rev < pdev->revision)) continue; |
2013 | if (b->svid) | 2011 | if (b->svid) |
2014 | if ((b->svid != svid) || (b->sid != sid)) continue; | 2012 | if ((b->svid != svid) || (b->sid != sid)) continue; |
2015 | break; | 2013 | break; |
diff --git a/drivers/video/sis/sis_main.c b/drivers/video/sis/sis_main.c index a30e1e13d8be..93d07ef85276 100644 --- a/drivers/video/sis/sis_main.c +++ b/drivers/video/sis/sis_main.c | |||
@@ -5789,7 +5789,7 @@ sisfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
5789 | ivideo->warncount = 0; | 5789 | ivideo->warncount = 0; |
5790 | ivideo->chip_id = pdev->device; | 5790 | ivideo->chip_id = pdev->device; |
5791 | ivideo->chip_vendor = pdev->vendor; | 5791 | ivideo->chip_vendor = pdev->vendor; |
5792 | pci_read_config_byte(pdev, PCI_REVISION_ID, &ivideo->revision_id); | 5792 | ivideo->revision_id = pdev->revision; |
5793 | ivideo->SiS_Pr.ChipRevision = ivideo->revision_id; | 5793 | ivideo->SiS_Pr.ChipRevision = ivideo->revision_id; |
5794 | pci_read_config_word(pdev, PCI_COMMAND, ®16); | 5794 | pci_read_config_word(pdev, PCI_COMMAND, ®16); |
5795 | ivideo->sisvga_enabled = reg16 & 0x01; | 5795 | ivideo->sisvga_enabled = reg16 & 0x01; |
diff --git a/drivers/video/sstfb.c b/drivers/video/sstfb.c index 62fa5500361d..5eff28ce4f4d 100644 --- a/drivers/video/sstfb.c +++ b/drivers/video/sstfb.c | |||
@@ -1348,7 +1348,7 @@ static int __devinit sstfb_probe(struct pci_dev *pdev, | |||
1348 | f_ddprintk("found device : %s\n", spec->name); | 1348 | f_ddprintk("found device : %s\n", spec->name); |
1349 | 1349 | ||
1350 | par->dev = pdev; | 1350 | par->dev = pdev; |
1351 | pci_read_config_byte(pdev, PCI_REVISION_ID, &par->revision); | 1351 | par->revision = pdev->revision; |
1352 | 1352 | ||
1353 | fix->mmio_start = pci_resource_start(pdev,0); | 1353 | fix->mmio_start = pci_resource_start(pdev,0); |
1354 | fix->mmio_len = 0x400000; | 1354 | fix->mmio_len = 0x400000; |
diff --git a/drivers/video/tgafb.c b/drivers/video/tgafb.c index f0fde6ea7c36..5c0dab628099 100644 --- a/drivers/video/tgafb.c +++ b/drivers/video/tgafb.c | |||
@@ -1625,8 +1625,7 @@ tgafb_register(struct device *dev) | |||
1625 | par->tga_regs_base = mem_base + TGA_REGS_OFFSET; | 1625 | par->tga_regs_base = mem_base + TGA_REGS_OFFSET; |
1626 | par->tga_type = tga_type; | 1626 | par->tga_type = tga_type; |
1627 | if (tga_bus_pci) | 1627 | if (tga_bus_pci) |
1628 | pci_read_config_byte(to_pci_dev(dev), PCI_REVISION_ID, | 1628 | par->tga_chip_rev = (to_pci_dev(dev))->revision; |
1629 | &par->tga_chip_rev); | ||
1630 | if (tga_bus_tc) | 1629 | if (tga_bus_tc) |
1631 | par->tga_chip_rev = TGA_READ_REG(par, TGA_START_REG) & 0xff; | 1630 | par->tga_chip_rev = TGA_READ_REG(par, TGA_START_REG) & 0xff; |
1632 | 1631 | ||
diff --git a/sound/oss/emu10k1/main.c b/sound/oss/emu10k1/main.c index 16ac02540a3f..5058411b7524 100644 --- a/sound/oss/emu10k1/main.c +++ b/sound/oss/emu10k1/main.c | |||
@@ -1302,7 +1302,7 @@ static int __devinit emu10k1_probe(struct pci_dev *pci_dev, const struct pci_dev | |||
1302 | goto err_irq; | 1302 | goto err_irq; |
1303 | } | 1303 | } |
1304 | 1304 | ||
1305 | pci_read_config_byte(pci_dev, PCI_REVISION_ID, &card->chiprev); | 1305 | card->chiprev = pci_dev->revision; |
1306 | pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &card->model); | 1306 | pci_read_config_word(pci_dev, PCI_SUBSYSTEM_ID, &card->model); |
1307 | 1307 | ||
1308 | printk(KERN_INFO "emu10k1: %s rev %d model %#04x found, IO at %#04lx-%#04lx, IRQ %d\n", | 1308 | printk(KERN_INFO "emu10k1: %s rev %d model %#04x found, IO at %#04lx-%#04lx, IRQ %d\n", |
diff --git a/sound/oss/es1371.c b/sound/oss/es1371.c index 593a3aac12ce..52648573f601 100644 --- a/sound/oss/es1371.c +++ b/sound/oss/es1371.c | |||
@@ -2894,7 +2894,7 @@ static int __devinit es1371_probe(struct pci_dev *pcidev, const struct pci_devic | |||
2894 | s->irq = pcidev->irq; | 2894 | s->irq = pcidev->irq; |
2895 | s->vendor = pcidev->vendor; | 2895 | s->vendor = pcidev->vendor; |
2896 | s->device = pcidev->device; | 2896 | s->device = pcidev->device; |
2897 | pci_read_config_byte(pcidev, PCI_REVISION_ID, &s->rev); | 2897 | s->rev = pcidev->revision; |
2898 | s->codec->private_data = s; | 2898 | s->codec->private_data = s; |
2899 | s->codec->id = 0; | 2899 | s->codec->id = 0; |
2900 | s->codec->codec_read = rdcodec; | 2900 | s->codec->codec_read = rdcodec; |
diff --git a/sound/pci/ali5451/ali5451.c b/sound/pci/ali5451/ali5451.c index cb59f994c68f..41543a4933e7 100644 --- a/sound/pci/ali5451/ali5451.c +++ b/sound/pci/ali5451/ali5451.c | |||
@@ -2218,7 +2218,7 @@ static int __devinit snd_ali_create(struct snd_card *card, | |||
2218 | codec->card = card; | 2218 | codec->card = card; |
2219 | codec->pci = pci; | 2219 | codec->pci = pci; |
2220 | codec->irq = -1; | 2220 | codec->irq = -1; |
2221 | pci_read_config_byte(pci, PCI_REVISION_ID, &codec->revision); | 2221 | codec->revision = pci->revision; |
2222 | codec->spdif_support = spdif_support; | 2222 | codec->spdif_support = spdif_support; |
2223 | 2223 | ||
2224 | if (pcm_streams < 1) | 2224 | if (pcm_streams < 1) |
diff --git a/sound/pci/atiixp.c b/sound/pci/atiixp.c index 7d8053b5e8d5..89184a424140 100644 --- a/sound/pci/atiixp.c +++ b/sound/pci/atiixp.c | |||
@@ -1639,15 +1639,12 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, | |||
1639 | { | 1639 | { |
1640 | struct snd_card *card; | 1640 | struct snd_card *card; |
1641 | struct atiixp *chip; | 1641 | struct atiixp *chip; |
1642 | unsigned char revision; | ||
1643 | int err; | 1642 | int err; |
1644 | 1643 | ||
1645 | card = snd_card_new(index, id, THIS_MODULE, 0); | 1644 | card = snd_card_new(index, id, THIS_MODULE, 0); |
1646 | if (card == NULL) | 1645 | if (card == NULL) |
1647 | return -ENOMEM; | 1646 | return -ENOMEM; |
1648 | 1647 | ||
1649 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); | ||
1650 | |||
1651 | strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA"); | 1648 | strcpy(card->driver, spdif_aclink ? "ATIIXP" : "ATIIXP-SPDMA"); |
1652 | strcpy(card->shortname, "ATI IXP"); | 1649 | strcpy(card->shortname, "ATI IXP"); |
1653 | if ((err = snd_atiixp_create(card, pci, &chip)) < 0) | 1650 | if ((err = snd_atiixp_create(card, pci, &chip)) < 0) |
@@ -1670,7 +1667,8 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, | |||
1670 | snd_atiixp_chip_start(chip); | 1667 | snd_atiixp_chip_start(chip); |
1671 | 1668 | ||
1672 | snprintf(card->longname, sizeof(card->longname), | 1669 | snprintf(card->longname, sizeof(card->longname), |
1673 | "%s rev %x with %s at %#lx, irq %i", card->shortname, revision, | 1670 | "%s rev %x with %s at %#lx, irq %i", card->shortname, |
1671 | pci->revision, | ||
1674 | chip->ac97[0] ? snd_ac97_get_short_name(chip->ac97[0]) : "?", | 1672 | chip->ac97[0] ? snd_ac97_get_short_name(chip->ac97[0]) : "?", |
1675 | chip->addr, chip->irq); | 1673 | chip->addr, chip->irq); |
1676 | 1674 | ||
diff --git a/sound/pci/atiixp_modem.c b/sound/pci/atiixp_modem.c index 904023fe4f26..ce752f84457a 100644 --- a/sound/pci/atiixp_modem.c +++ b/sound/pci/atiixp_modem.c | |||
@@ -1283,15 +1283,12 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, | |||
1283 | { | 1283 | { |
1284 | struct snd_card *card; | 1284 | struct snd_card *card; |
1285 | struct atiixp_modem *chip; | 1285 | struct atiixp_modem *chip; |
1286 | unsigned char revision; | ||
1287 | int err; | 1286 | int err; |
1288 | 1287 | ||
1289 | card = snd_card_new(index, id, THIS_MODULE, 0); | 1288 | card = snd_card_new(index, id, THIS_MODULE, 0); |
1290 | if (card == NULL) | 1289 | if (card == NULL) |
1291 | return -ENOMEM; | 1290 | return -ENOMEM; |
1292 | 1291 | ||
1293 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); | ||
1294 | |||
1295 | strcpy(card->driver, "ATIIXP-MODEM"); | 1292 | strcpy(card->driver, "ATIIXP-MODEM"); |
1296 | strcpy(card->shortname, "ATI IXP Modem"); | 1293 | strcpy(card->shortname, "ATI IXP Modem"); |
1297 | if ((err = snd_atiixp_create(card, pci, &chip)) < 0) | 1294 | if ((err = snd_atiixp_create(card, pci, &chip)) < 0) |
@@ -1312,7 +1309,7 @@ static int __devinit snd_atiixp_probe(struct pci_dev *pci, | |||
1312 | snd_atiixp_chip_start(chip); | 1309 | snd_atiixp_chip_start(chip); |
1313 | 1310 | ||
1314 | sprintf(card->longname, "%s rev %x at 0x%lx, irq %i", | 1311 | sprintf(card->longname, "%s rev %x at 0x%lx, irq %i", |
1315 | card->shortname, revision, chip->addr, chip->irq); | 1312 | card->shortname, pci->revision, chip->addr, chip->irq); |
1316 | 1313 | ||
1317 | if ((err = snd_card_register(card)) < 0) | 1314 | if ((err = snd_card_register(card)) < 0) |
1318 | goto __error; | 1315 | goto __error; |
diff --git a/sound/pci/au88x0/au88x0.c b/sound/pci/au88x0/au88x0.c index 238154bb7a25..5ec1b6fcd548 100644 --- a/sound/pci/au88x0/au88x0.c +++ b/sound/pci/au88x0/au88x0.c | |||
@@ -341,11 +341,7 @@ snd_vortex_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) | |||
341 | snd_card_free(card); | 341 | snd_card_free(card); |
342 | return err; | 342 | return err; |
343 | } | 343 | } |
344 | if ((err = pci_read_config_byte(pci, PCI_REVISION_ID, | 344 | chip->rev = pci->revision; |
345 | &(chip->rev))) < 0) { | ||
346 | snd_card_free(card); | ||
347 | return err; | ||
348 | } | ||
349 | #ifdef CHIP_AU8830 | 345 | #ifdef CHIP_AU8830 |
350 | if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) { | 346 | if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) { |
351 | printk(KERN_ALERT | 347 | printk(KERN_ALERT |
diff --git a/sound/pci/ca0106/ca0106.h b/sound/pci/ca0106/ca0106.h index aaac6e5b4767..a0420bc63f0b 100644 --- a/sound/pci/ca0106/ca0106.h +++ b/sound/pci/ca0106/ca0106.h | |||
@@ -590,7 +590,6 @@ struct snd_ca0106 { | |||
590 | struct resource *res_port; | 590 | struct resource *res_port; |
591 | int irq; | 591 | int irq; |
592 | 592 | ||
593 | unsigned char revision; /* chip revision */ | ||
594 | unsigned int serial; /* serial number */ | 593 | unsigned int serial; /* serial number */ |
595 | unsigned short model; /* subsystem id */ | 594 | unsigned short model; /* subsystem id */ |
596 | 595 | ||
diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c index 48f3f17c5170..9fd7b8a5b75e 100644 --- a/sound/pci/ca0106/ca0106_main.c +++ b/sound/pci/ca0106/ca0106_main.c | |||
@@ -1293,13 +1293,12 @@ static int __devinit snd_ca0106_create(int dev, struct snd_card *card, | |||
1293 | } | 1293 | } |
1294 | 1294 | ||
1295 | pci_set_master(pci); | 1295 | pci_set_master(pci); |
1296 | /* read revision & serial */ | 1296 | /* read serial */ |
1297 | pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision); | ||
1298 | pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); | 1297 | pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); |
1299 | pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); | 1298 | pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); |
1300 | #if 1 | 1299 | #if 1 |
1301 | printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model, | 1300 | printk(KERN_INFO "snd-ca0106: Model %04x Rev %08x Serial %08x\n", chip->model, |
1302 | chip->revision, chip->serial); | 1301 | pci->revision, chip->serial); |
1303 | #endif | 1302 | #endif |
1304 | strcpy(card->driver, "CA0106"); | 1303 | strcpy(card->driver, "CA0106"); |
1305 | strcpy(card->shortname, "CA0106"); | 1304 | strcpy(card->shortname, "CA0106"); |
diff --git a/sound/pci/emu10k1/emu10k1_main.c b/sound/pci/emu10k1/emu10k1_main.c index dbc805c33fc4..4a9b59ad8ab1 100644 --- a/sound/pci/emu10k1/emu10k1_main.c +++ b/sound/pci/emu10k1/emu10k1_main.c | |||
@@ -1511,7 +1511,6 @@ int __devinit snd_emu10k1_create(struct snd_card *card, | |||
1511 | struct snd_emu10k1 *emu; | 1511 | struct snd_emu10k1 *emu; |
1512 | int idx, err; | 1512 | int idx, err; |
1513 | int is_audigy; | 1513 | int is_audigy; |
1514 | unsigned char revision; | ||
1515 | unsigned int silent_page; | 1514 | unsigned int silent_page; |
1516 | const struct snd_emu_chip_details *c; | 1515 | const struct snd_emu_chip_details *c; |
1517 | static struct snd_device_ops ops = { | 1516 | static struct snd_device_ops ops = { |
@@ -1543,8 +1542,7 @@ int __devinit snd_emu10k1_create(struct snd_card *card, | |||
1543 | emu->synth = NULL; | 1542 | emu->synth = NULL; |
1544 | emu->get_synth_voice = NULL; | 1543 | emu->get_synth_voice = NULL; |
1545 | /* read revision & serial */ | 1544 | /* read revision & serial */ |
1546 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); | 1545 | emu->revision = pci->revision; |
1547 | emu->revision = revision; | ||
1548 | pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial); | 1546 | pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &emu->serial); |
1549 | pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model); | 1547 | pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &emu->model); |
1550 | snd_printdd("vendor=0x%x, device=0x%x, subsystem_vendor_id=0x%x, subsystem_id=0x%x\n",pci->vendor, pci->device, emu->serial, emu->model); | 1548 | snd_printdd("vendor=0x%x, device=0x%x, subsystem_vendor_id=0x%x, subsystem_id=0x%x\n",pci->vendor, pci->device, emu->serial, emu->model); |
diff --git a/sound/pci/emu10k1/emu10k1x.c b/sound/pci/emu10k1/emu10k1x.c index bb0fec7f7e1b..e4af7a9b808c 100644 --- a/sound/pci/emu10k1/emu10k1x.c +++ b/sound/pci/emu10k1/emu10k1x.c | |||
@@ -942,7 +942,7 @@ static int __devinit snd_emu10k1x_create(struct snd_card *card, | |||
942 | 942 | ||
943 | pci_set_master(pci); | 943 | pci_set_master(pci); |
944 | /* read revision & serial */ | 944 | /* read revision & serial */ |
945 | pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision); | 945 | chip->revision = pci->revision; |
946 | pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); | 946 | pci_read_config_dword(pci, PCI_SUBSYSTEM_VENDOR_ID, &chip->serial); |
947 | pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); | 947 | pci_read_config_word(pci, PCI_SUBSYSTEM_ID, &chip->model); |
948 | snd_printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model, | 948 | snd_printk(KERN_INFO "Model %04x Rev %08x Serial %08x\n", chip->model, |
diff --git a/sound/pci/ens1370.c b/sound/pci/ens1370.c index 6a0ddcf00884..7c403965153b 100644 --- a/sound/pci/ens1370.c +++ b/sound/pci/ens1370.c | |||
@@ -2110,7 +2110,6 @@ static int __devinit snd_ensoniq_create(struct snd_card *card, | |||
2110 | struct ensoniq ** rensoniq) | 2110 | struct ensoniq ** rensoniq) |
2111 | { | 2111 | { |
2112 | struct ensoniq *ensoniq; | 2112 | struct ensoniq *ensoniq; |
2113 | unsigned char cmdb; | ||
2114 | int err; | 2113 | int err; |
2115 | static struct snd_device_ops ops = { | 2114 | static struct snd_device_ops ops = { |
2116 | .dev_free = snd_ensoniq_dev_free, | 2115 | .dev_free = snd_ensoniq_dev_free, |
@@ -2151,8 +2150,7 @@ static int __devinit snd_ensoniq_create(struct snd_card *card, | |||
2151 | } | 2150 | } |
2152 | #endif | 2151 | #endif |
2153 | pci_set_master(pci); | 2152 | pci_set_master(pci); |
2154 | pci_read_config_byte(pci, PCI_REVISION_ID, &cmdb); | 2153 | ensoniq->rev = pci->revision; |
2155 | ensoniq->rev = cmdb; | ||
2156 | #ifdef CHIP1370 | 2154 | #ifdef CHIP1370 |
2157 | #if 0 | 2155 | #if 0 |
2158 | ensoniq->ctrl = ES_1370_CDC_EN | ES_1370_SERR_DISABLE | | 2156 | ensoniq->ctrl = ES_1370_CDC_EN | ES_1370_SERR_DISABLE | |
diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c index 6dc578bbeec9..11015178e207 100644 --- a/sound/pci/fm801.c +++ b/sound/pci/fm801.c | |||
@@ -1369,7 +1369,6 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1369 | struct fm801 ** rchip) | 1369 | struct fm801 ** rchip) |
1370 | { | 1370 | { |
1371 | struct fm801 *chip; | 1371 | struct fm801 *chip; |
1372 | unsigned char rev; | ||
1373 | int err; | 1372 | int err; |
1374 | static struct snd_device_ops ops = { | 1373 | static struct snd_device_ops ops = { |
1375 | .dev_free = snd_fm801_dev_free, | 1374 | .dev_free = snd_fm801_dev_free, |
@@ -1405,8 +1404,7 @@ static int __devinit snd_fm801_create(struct snd_card *card, | |||
1405 | pci_set_master(pci); | 1404 | pci_set_master(pci); |
1406 | } | 1405 | } |
1407 | 1406 | ||
1408 | pci_read_config_byte(pci, PCI_REVISION_ID, &rev); | 1407 | if (pci->revision >= 0xb1) /* FM801-AU */ |
1409 | if (rev >= 0xb1) /* FM801-AU */ | ||
1410 | chip->multichannel = 1; | 1408 | chip->multichannel = 1; |
1411 | 1409 | ||
1412 | snd_fm801_chip_init(chip, 0); | 1410 | snd_fm801_chip_init(chip, 0); |
diff --git a/sound/pci/via82xx.c b/sound/pci/via82xx.c index a28992269f5e..50c9f92cfd1b 100644 --- a/sound/pci/via82xx.c +++ b/sound/pci/via82xx.c | |||
@@ -2431,7 +2431,6 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
2431 | { | 2431 | { |
2432 | struct snd_card *card; | 2432 | struct snd_card *card; |
2433 | struct via82xx *chip; | 2433 | struct via82xx *chip; |
2434 | unsigned char revision; | ||
2435 | int chip_type = 0, card_type; | 2434 | int chip_type = 0, card_type; |
2436 | unsigned int i; | 2435 | unsigned int i; |
2437 | int err; | 2436 | int err; |
@@ -2441,18 +2440,17 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
2441 | return -ENOMEM; | 2440 | return -ENOMEM; |
2442 | 2441 | ||
2443 | card_type = pci_id->driver_data; | 2442 | card_type = pci_id->driver_data; |
2444 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); | ||
2445 | switch (card_type) { | 2443 | switch (card_type) { |
2446 | case TYPE_CARD_VIA686: | 2444 | case TYPE_CARD_VIA686: |
2447 | strcpy(card->driver, "VIA686A"); | 2445 | strcpy(card->driver, "VIA686A"); |
2448 | sprintf(card->shortname, "VIA 82C686A/B rev%x", revision); | 2446 | sprintf(card->shortname, "VIA 82C686A/B rev%x", pci->revision); |
2449 | chip_type = TYPE_VIA686; | 2447 | chip_type = TYPE_VIA686; |
2450 | break; | 2448 | break; |
2451 | case TYPE_CARD_VIA8233: | 2449 | case TYPE_CARD_VIA8233: |
2452 | chip_type = TYPE_VIA8233; | 2450 | chip_type = TYPE_VIA8233; |
2453 | sprintf(card->shortname, "VIA 823x rev%x", revision); | 2451 | sprintf(card->shortname, "VIA 823x rev%x", pci->revision); |
2454 | for (i = 0; i < ARRAY_SIZE(via823x_cards); i++) { | 2452 | for (i = 0; i < ARRAY_SIZE(via823x_cards); i++) { |
2455 | if (revision == via823x_cards[i].revision) { | 2453 | if (pci->revision == via823x_cards[i].revision) { |
2456 | chip_type = via823x_cards[i].type; | 2454 | chip_type = via823x_cards[i].type; |
2457 | strcpy(card->shortname, via823x_cards[i].name); | 2455 | strcpy(card->shortname, via823x_cards[i].name); |
2458 | break; | 2456 | break; |
@@ -2460,7 +2458,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
2460 | } | 2458 | } |
2461 | if (chip_type != TYPE_VIA8233A) { | 2459 | if (chip_type != TYPE_VIA8233A) { |
2462 | if (dxs_support == VIA_DXS_AUTO) | 2460 | if (dxs_support == VIA_DXS_AUTO) |
2463 | dxs_support = check_dxs_list(pci, revision); | 2461 | dxs_support = check_dxs_list(pci, pci->revision); |
2464 | /* force to use VIA8233 or 8233A model according to | 2462 | /* force to use VIA8233 or 8233A model according to |
2465 | * dxs_support module option | 2463 | * dxs_support module option |
2466 | */ | 2464 | */ |
@@ -2471,7 +2469,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
2471 | } | 2469 | } |
2472 | if (chip_type == TYPE_VIA8233A) | 2470 | if (chip_type == TYPE_VIA8233A) |
2473 | strcpy(card->driver, "VIA8233A"); | 2471 | strcpy(card->driver, "VIA8233A"); |
2474 | else if (revision >= VIA_REV_8237) | 2472 | else if (pci->revision >= VIA_REV_8237) |
2475 | strcpy(card->driver, "VIA8237"); /* no slog assignment */ | 2473 | strcpy(card->driver, "VIA8237"); /* no slog assignment */ |
2476 | else | 2474 | else |
2477 | strcpy(card->driver, "VIA8233"); | 2475 | strcpy(card->driver, "VIA8233"); |
@@ -2482,7 +2480,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
2482 | goto __error; | 2480 | goto __error; |
2483 | } | 2481 | } |
2484 | 2482 | ||
2485 | if ((err = snd_via82xx_create(card, pci, chip_type, revision, | 2483 | if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision, |
2486 | ac97_clock, &chip)) < 0) | 2484 | ac97_clock, &chip)) < 0) |
2487 | goto __error; | 2485 | goto __error; |
2488 | card->private_data = chip; | 2486 | card->private_data = chip; |
diff --git a/sound/pci/via82xx_modem.c b/sound/pci/via82xx_modem.c index b338e15db0d9..8cbf8eba4ae9 100644 --- a/sound/pci/via82xx_modem.c +++ b/sound/pci/via82xx_modem.c | |||
@@ -1162,7 +1162,6 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
1162 | { | 1162 | { |
1163 | struct snd_card *card; | 1163 | struct snd_card *card; |
1164 | struct via82xx_modem *chip; | 1164 | struct via82xx_modem *chip; |
1165 | unsigned char revision; | ||
1166 | int chip_type = 0, card_type; | 1165 | int chip_type = 0, card_type; |
1167 | unsigned int i; | 1166 | unsigned int i; |
1168 | int err; | 1167 | int err; |
@@ -1172,7 +1171,6 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
1172 | return -ENOMEM; | 1171 | return -ENOMEM; |
1173 | 1172 | ||
1174 | card_type = pci_id->driver_data; | 1173 | card_type = pci_id->driver_data; |
1175 | pci_read_config_byte(pci, PCI_REVISION_ID, &revision); | ||
1176 | switch (card_type) { | 1174 | switch (card_type) { |
1177 | case TYPE_CARD_VIA82XX_MODEM: | 1175 | case TYPE_CARD_VIA82XX_MODEM: |
1178 | strcpy(card->driver, "VIA82XX-MODEM"); | 1176 | strcpy(card->driver, "VIA82XX-MODEM"); |
@@ -1184,7 +1182,7 @@ static int __devinit snd_via82xx_probe(struct pci_dev *pci, | |||
1184 | goto __error; | 1182 | goto __error; |
1185 | } | 1183 | } |
1186 | 1184 | ||
1187 | if ((err = snd_via82xx_create(card, pci, chip_type, revision, | 1185 | if ((err = snd_via82xx_create(card, pci, chip_type, pci->revision, |
1188 | ac97_clock, &chip)) < 0) | 1186 | ac97_clock, &chip)) < 0) |
1189 | goto __error; | 1187 | goto __error; |
1190 | card->private_data = chip; | 1188 | card->private_data = chip; |
diff --git a/sound/pci/ymfpci/ymfpci_main.c b/sound/pci/ymfpci/ymfpci_main.c index ea861bceaddf..ab7a81c35705 100644 --- a/sound/pci/ymfpci/ymfpci_main.c +++ b/sound/pci/ymfpci/ymfpci_main.c | |||
@@ -2404,7 +2404,7 @@ int __devinit snd_ymfpci_create(struct snd_card *card, | |||
2404 | chip->pci = pci; | 2404 | chip->pci = pci; |
2405 | chip->irq = -1; | 2405 | chip->irq = -1; |
2406 | chip->device_id = pci->device; | 2406 | chip->device_id = pci->device; |
2407 | pci_read_config_byte(pci, PCI_REVISION_ID, &chip->rev); | 2407 | chip->rev = pci->revision; |
2408 | chip->reg_area_phys = pci_resource_start(pci, 0); | 2408 | chip->reg_area_phys = pci_resource_start(pci, 0); |
2409 | chip->reg_area_virt = ioremap_nocache(chip->reg_area_phys, 0x8000); | 2409 | chip->reg_area_virt = ioremap_nocache(chip->reg_area_phys, 0x8000); |
2410 | pci_set_master(pci); | 2410 | pci_set_master(pci); |