]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
ACPI: check acpi_disabled in acpi_table_parse() and acpi_table_parse_entries()
authorLen Brown <len.brown@intel.com>
Mon, 18 Jan 2016 13:53:41 +0000 (14:53 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 18 Jan 2016 13:53:41 +0000 (14:53 +0100)
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>
[Linux commit e5b8fc6ac158f65598f58dba2c0d52ba3b412f52]
Signed-off-by: Shannon Zhao <shannon.zhao@linaro.org>
xen/drivers/acpi/tables.c

index 60c4ab1d3aa333756449a48e194c896108a145c1..39f12231ff4bb4aacb27412606610233e740fbe6 100644 (file)
@@ -210,6 +210,9 @@ acpi_table_parse_entries(char *id,
        unsigned int count = 0;
        unsigned long table_end;
 
+       if (acpi_disabled)
+               return -ENODEV;
+
        if (!handler)
                return -EINVAL;
 
@@ -279,6 +282,9 @@ int __init acpi_table_parse(char *id, acpi_table_handler handler)
 {
        struct acpi_table_header *table = NULL;
 
+       if (acpi_disabled)
+               return -ENODEV;
+
        if (!handler)
                return -EINVAL;