ACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()
authorLen Brown <len.brown@intel.com>
Wed, 8 Jul 2009 03:22:58 +0000 (23:22 -0400)
committerLen Brown <len.brown@intel.com>
Fri, 28 Aug 2009 23:57:28 +0000 (19:57 -0400)
Allow consumers of the acpi_table_parse()/acpi_table_parse_entries() API
to gracefully handle the acpi_disabled=1 case via return value
rather than checking the global flag themselves.

Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
drivers/acpi/tables.c

index 646d39c031caa4cc6de4a9884fea83fdf945e92a..f336bca7c4503ec1d03d7741ee8185afae942381 100644 (file)
@@ -213,6 +213,9 @@ acpi_table_parse_entries(char *id,
        unsigned long table_end;
        acpi_size tbl_size;
 
+       if (acpi_disabled)
+               return -ENODEV;
+
        if (!handler)
                return -EINVAL;
 
@@ -277,6 +280,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
        struct acpi_table_header *table = NULL;
        acpi_size tbl_size;
 
+       if (acpi_disabled)
+               return -ENODEV;
+
        if (!handler)
                return -EINVAL;