diff options
author | Len Brown <len.brown@intel.com> | 2007-02-10 21:28:03 -0500 |
---|---|---|
committer | Len Brown <len.brown@intel.com> | 2007-02-13 02:58:52 -0500 |
commit | 7f8f97c3cc75d5783d0b45cf323dedf17684be19 (patch) | |
tree | 347a8b2e06904598fea849c533a866727addaf5e | |
parent | 7cda93e008e1a477970adbf82dba81a5d4f0ae40 (diff) |
ACPI: acpi_table_parse() now returns success/fail, not count
Returning count for tables that are supposed to be unique
was useless and confusing.
Signed-off-by: Len Brown <len.brown@intel.com>
-rw-r--r-- | arch/i386/kernel/acpi/boot.c | 5 | ||||
-rw-r--r-- | arch/x86_64/kernel/early-quirks.c | 4 | ||||
-rw-r--r-- | arch/x86_64/pci/mmconfig.c | 4 | ||||
-rw-r--r-- | drivers/acpi/numa.c | 6 | ||||
-rw-r--r-- | drivers/acpi/tables.c | 13 |
5 files changed, 21 insertions, 11 deletions
diff --git a/arch/i386/kernel/acpi/boot.c b/arch/i386/kernel/acpi/boot.c index e94aff6888ca..7ac7b67b8519 100644 --- a/arch/i386/kernel/acpi/boot.c +++ b/arch/i386/kernel/acpi/boot.c | |||
@@ -865,10 +865,9 @@ static inline int acpi_parse_madt_ioapic_entries(void) | |||
865 | static void __init acpi_process_madt(void) | 865 | static void __init acpi_process_madt(void) |
866 | { | 866 | { |
867 | #ifdef CONFIG_X86_LOCAL_APIC | 867 | #ifdef CONFIG_X86_LOCAL_APIC |
868 | int count, error; | 868 | int error; |
869 | 869 | ||
870 | count = acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt); | 870 | if (!acpi_table_parse(ACPI_SIG_MADT, acpi_parse_madt)) { |
871 | if (count >= 1) { | ||
872 | 871 | ||
873 | /* | 872 | /* |
874 | * Parse MADT LAPIC entries | 873 | * Parse MADT LAPIC entries |
diff --git a/arch/x86_64/kernel/early-quirks.c b/arch/x86_64/kernel/early-quirks.c index bd30d138113f..8047ea8c2ab2 100644 --- a/arch/x86_64/kernel/early-quirks.c +++ b/arch/x86_64/kernel/early-quirks.c | |||
@@ -53,7 +53,9 @@ static void nvidia_bugs(void) | |||
53 | return; | 53 | return; |
54 | 54 | ||
55 | nvidia_hpet_detected = 0; | 55 | nvidia_hpet_detected = 0; |
56 | acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check); | 56 | if (acpi_table_parse(ACPI_SIG_HPET, nvidia_hpet_check)) |
57 | return; | ||
58 | |||
57 | if (nvidia_hpet_detected == 0) { | 59 | if (nvidia_hpet_detected == 0) { |
58 | acpi_skip_timer_override = 1; | 60 | acpi_skip_timer_override = 1; |
59 | printk(KERN_INFO "Nvidia board " | 61 | printk(KERN_INFO "Nvidia board " |
diff --git a/arch/x86_64/pci/mmconfig.c b/arch/x86_64/pci/mmconfig.c index faabb6e87f12..98202cb50d8a 100644 --- a/arch/x86_64/pci/mmconfig.c +++ b/arch/x86_64/pci/mmconfig.c | |||
@@ -170,7 +170,9 @@ void __init pci_mmcfg_init(int type) | |||
170 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) | 170 | if ((pci_probe & PCI_PROBE_MMCONF) == 0) |
171 | return; | 171 | return; |
172 | 172 | ||
173 | acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg); | 173 | if (acpi_table_parse(ACPI_SIG_MCFG, acpi_parse_mcfg)) |
174 | return; | ||
175 | |||
174 | if ((pci_mmcfg_config_num == 0) || | 176 | if ((pci_mmcfg_config_num == 0) || |
175 | (pci_mmcfg_config == NULL) || | 177 | (pci_mmcfg_config == NULL) || |
176 | (pci_mmcfg_config[0].address == 0)) | 178 | (pci_mmcfg_config[0].address == 0)) |
diff --git a/drivers/acpi/numa.c b/drivers/acpi/numa.c index dcd58a446f4b..bb6caab24322 100644 --- a/drivers/acpi/numa.c +++ b/drivers/acpi/numa.c | |||
@@ -220,9 +220,7 @@ int __init acpi_numa_init(void) | |||
220 | int result; | 220 | int result; |
221 | 221 | ||
222 | /* SRAT: Static Resource Affinity Table */ | 222 | /* SRAT: Static Resource Affinity Table */ |
223 | result = acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat); | 223 | if (!acpi_table_parse(ACPI_SIG_SRAT, acpi_parse_srat)) { |
224 | |||
225 | if (result > 0) { | ||
226 | result = acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, | 224 | result = acpi_table_parse_srat(ACPI_SRAT_TYPE_CPU_AFFINITY, |
227 | acpi_parse_processor_affinity, | 225 | acpi_parse_processor_affinity, |
228 | NR_CPUS); | 226 | NR_CPUS); |
@@ -230,7 +228,7 @@ int __init acpi_numa_init(void) | |||
230 | } | 228 | } |
231 | 229 | ||
232 | /* SLIT: System Locality Information Table */ | 230 | /* SLIT: System Locality Information Table */ |
233 | result = acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); | 231 | acpi_table_parse(ACPI_SIG_SLIT, acpi_parse_slit); |
234 | 232 | ||
235 | acpi_numa_arch_fixup(); | 233 | acpi_numa_arch_fixup(); |
236 | return 0; | 234 | return 0; |
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c index ba4cb200314a..2075ec7b827b 100644 --- a/drivers/acpi/tables.c +++ b/drivers/acpi/tables.c | |||
@@ -226,6 +226,15 @@ acpi_table_parse_madt(enum acpi_madt_type id, | |||
226 | handler, max_entries); | 226 | handler, max_entries); |
227 | } | 227 | } |
228 | 228 | ||
229 | /** | ||
230 | * acpi_table_parse - find table with @id, run @handler on it | ||
231 | * | ||
232 | * @id: table id to find | ||
233 | * @handler: handler to run | ||
234 | * | ||
235 | * Scan the ACPI System Descriptor Table (STD) for a table matching @id, | ||
236 | * run @handler on it. Return 0 if table found, return on if not. | ||
237 | */ | ||
229 | int __init acpi_table_parse(char *id, acpi_table_handler handler) | 238 | int __init acpi_table_parse(char *id, acpi_table_handler handler) |
230 | { | 239 | { |
231 | struct acpi_table_header *table = NULL; | 240 | struct acpi_table_header *table = NULL; |
@@ -235,9 +244,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler) | |||
235 | acpi_get_table(id, 0, &table); | 244 | acpi_get_table(id, 0, &table); |
236 | if (table) { | 245 | if (table) { |
237 | handler(table); | 246 | handler(table); |
238 | return 1; | ||
239 | } else | ||
240 | return 0; | 247 | return 0; |
248 | } else | ||
249 | return 1; | ||
241 | } | 250 | } |
242 | 251 | ||
243 | /* | 252 | /* |