]> Git Repo - linux.git/blobdiff - drivers/acpi/tables.c
iptables: use match, target and data copy_to_user helpers
[linux.git] / drivers / acpi / tables.c
index 9f0ad6ebb368a9245c04993ba2c088144b95df02..2604189d6cd156e5449c7dd071d63120ea000a0e 100644 (file)
@@ -35,7 +35,6 @@
 #include <linux/earlycpio.h>
 #include <linux/memblock.h>
 #include <linux/initrd.h>
-#include <linux/acpi.h>
 #include "internal.h"
 
 #ifdef CONFIG_ACPI_CUSTOM_DSDT
@@ -246,6 +245,7 @@ acpi_parse_entries_array(char *id, unsigned long table_size,
        struct acpi_subtable_header *entry;
        unsigned long table_end;
        int count = 0;
+       int errs = 0;
        int i;
 
        if (acpi_disabled)
@@ -278,10 +278,12 @@ acpi_parse_entries_array(char *id, unsigned long table_size,
                        if (entry->type != proc[i].id)
                                continue;
                        if (!proc[i].handler ||
-                            proc[i].handler(entry, table_end))
-                               return -EINVAL;
+                            (!errs && proc[i].handler(entry, table_end))) {
+                               errs++;
+                               continue;
+                       }
 
-                       proc->count++;
+                       proc[i].count++;
                        break;
                }
                if (i != proc_num)
@@ -301,11 +303,11 @@ acpi_parse_entries_array(char *id, unsigned long table_size,
        }
 
        if (max_entries && count > max_entries) {
-               pr_warn("[%4.4s:0x%02x] ignored %i entries of %i found\n",
-                       id, proc->id, count - max_entries, count);
+               pr_warn("[%4.4s:0x%02x] found the maximum %i entries\n",
+                       id, proc->id, count);
        }
 
-       return count;
+       return errs ? -EINVAL : count;
 }
 
 int __init
@@ -331,7 +333,6 @@ acpi_table_parse_entries_array(char *id,
                         unsigned int max_entries)
 {
        struct acpi_table_header *table_header = NULL;
-       acpi_size tbl_size;
        int count;
        u32 instance = 0;
 
@@ -344,7 +345,7 @@ acpi_table_parse_entries_array(char *id,
        if (!strncmp(id, ACPI_SIG_MADT, 4))
                instance = acpi_apic_instance;
 
-       acpi_get_table_with_size(id, instance, &table_header, &tbl_size);
+       acpi_get_table(id, instance, &table_header);
        if (!table_header) {
                pr_warn("%4.4s not present\n", id);
                return -ENODEV;
@@ -353,7 +354,7 @@ acpi_table_parse_entries_array(char *id,
        count = acpi_parse_entries_array(id, table_size, table_header,
                        proc, proc_num, max_entries);
 
-       early_acpi_os_unmap_memory((char *)table_header, tbl_size);
+       acpi_put_table(table_header);
        return count;
 }
 
@@ -395,7 +396,6 @@ acpi_table_parse_madt(enum acpi_madt_type id,
 int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
 {
        struct acpi_table_header *table = NULL;
-       acpi_size tbl_size;
 
        if (acpi_disabled)
                return -ENODEV;
@@ -404,13 +404,13 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
                return -EINVAL;
 
        if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
-               acpi_get_table_with_size(id, acpi_apic_instance, &table, &tbl_size);
+               acpi_get_table(id, acpi_apic_instance, &table);
        else
-               acpi_get_table_with_size(id, 0, &table, &tbl_size);
+               acpi_get_table(id, 0, &table);
 
        if (table) {
                handler(table);
-               early_acpi_os_unmap_memory(table, tbl_size);
+               acpi_put_table(table);
                return 0;
        } else
                return -ENODEV;
@@ -424,16 +424,15 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
 static void __init check_multiple_madt(void)
 {
        struct acpi_table_header *table = NULL;
-       acpi_size tbl_size;
 
-       acpi_get_table_with_size(ACPI_SIG_MADT, 2, &table, &tbl_size);
+       acpi_get_table(ACPI_SIG_MADT, 2, &table);
        if (table) {
                pr_warn("BIOS bug: multiple APIC/MADT found, using %d\n",
                        acpi_apic_instance);
                pr_warn("If \"acpi_apic_instance=%d\" works better, "
                        "notify [email protected]\n",
                        acpi_apic_instance ? 0 : 2);
-               early_acpi_os_unmap_memory(table, tbl_size);
+               acpi_put_table(table);
 
        } else
                acpi_apic_instance = 0;
This page took 0.03658 seconds and 4 git commands to generate.