ACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()

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>
This commit is contained in:
Len Brown 2009-07-07 23:22:58 -04:00
parent f4a2d5840e
commit e5b8fc6ac1
1 changed files with 6 additions and 0 deletions

View File

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