|
@@ -278,12 +278,13 @@ acpi_table_parse_madt(enum acpi_madt_type id,
|
|
|
|
|
|
/**
|
|
/**
|
|
* acpi_table_parse - find table with @id, run @handler on it
|
|
* acpi_table_parse - find table with @id, run @handler on it
|
|
- *
|
|
|
|
* @id: table id to find
|
|
* @id: table id to find
|
|
* @handler: handler to run
|
|
* @handler: handler to run
|
|
*
|
|
*
|
|
* Scan the ACPI System Descriptor Table (STD) for a table matching @id,
|
|
* Scan the ACPI System Descriptor Table (STD) for a table matching @id,
|
|
- * run @handler on it. Return 0 if table found, return on if not.
|
|
|
|
|
|
+ * run @handler on it.
|
|
|
|
+ *
|
|
|
|
+ * Return 0 if table found, -errno if not.
|
|
*/
|
|
*/
|
|
int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
|
|
int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
|
|
{
|
|
{
|
|
@@ -293,7 +294,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
|
|
if (acpi_disabled)
|
|
if (acpi_disabled)
|
|
return -ENODEV;
|
|
return -ENODEV;
|
|
|
|
|
|
- if (!handler)
|
|
|
|
|
|
+ if (!id || !handler)
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
|
|
if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
|
|
@@ -306,7 +307,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
|
|
early_acpi_os_unmap_memory(table, tbl_size);
|
|
early_acpi_os_unmap_memory(table, tbl_size);
|
|
return 0;
|
|
return 0;
|
|
} else
|
|
} else
|
|
- return 1;
|
|
|
|
|
|
+ return -ENODEV;
|
|
}
|
|
}
|
|
|
|
|
|
/*
|
|
/*
|
|
@@ -351,7 +352,7 @@ int __init acpi_table_init(void)
|
|
|
|
|
|
status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
|
|
status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
|
|
if (ACPI_FAILURE(status))
|
|
if (ACPI_FAILURE(status))
|
|
- return 1;
|
|
|
|
|
|
+ return -EINVAL;
|
|
|
|
|
|
check_multiple_madt();
|
|
check_multiple_madt();
|
|
return 0;
|
|
return 0;
|