diff options
author | Auke Kok <auke-jan.h.kok@intel.com> | 2007-06-08 18:46:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:02:10 -0400 |
commit | 44c10138fd4bbc4b6d6bff0873c24902f2a9da65 (patch) | |
tree | 6e16d3ec80c87490dc743f72da086356f2906ace /drivers/acpi | |
parent | b8a3a5214d7cc115f1ca3a3967b7229d97c46f4a (diff) |
PCI: Change all drivers to use pci_device->revision
Instead of all drivers reading pci config space to get the revision
ID, they can now use the pci_device->revision member.
This exposes some issues where drivers where reading a word or a dword
for the revision number, and adding useless error-handling around the
read. Some drivers even just read it for no purpose of all.
In devices where the revision ID is being copied over and used in what
appears to be the equivalent of hotpath, I have left the copy code
and the cached copy as not to influence the driver's performance.
Compile tested with make all{yes,mod}config on x86_64 and i386.
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Acked-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/processor_core.c | 7 |
1 files changed, 2 insertions, 5 deletions
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 */ |