aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/tables.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/tables.c')
-rw-r--r--drivers/acpi/tables.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/drivers/acpi/tables.c b/drivers/acpi/tables.c
index d67a1fe07f0e..5837f857ac2e 100644
--- a/drivers/acpi/tables.c
+++ b/drivers/acpi/tables.c
@@ -278,12 +278,13 @@ acpi_table_parse_madt(enum acpi_madt_type id,
278 278
279/** 279/**
280 * acpi_table_parse - find table with @id, run @handler on it 280 * acpi_table_parse - find table with @id, run @handler on it
281 *
282 * @id: table id to find 281 * @id: table id to find
283 * @handler: handler to run 282 * @handler: handler to run
284 * 283 *
285 * Scan the ACPI System Descriptor Table (STD) for a table matching @id, 284 * Scan the ACPI System Descriptor Table (STD) for a table matching @id,
286 * run @handler on it. Return 0 if table found, return on if not. 285 * run @handler on it.
286 *
287 * Return 0 if table found, -errno if not.
287 */ 288 */
288int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler) 289int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
289{ 290{
@@ -293,7 +294,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
293 if (acpi_disabled) 294 if (acpi_disabled)
294 return -ENODEV; 295 return -ENODEV;
295 296
296 if (!handler) 297 if (!id || !handler)
297 return -EINVAL; 298 return -EINVAL;
298 299
299 if (strncmp(id, ACPI_SIG_MADT, 4) == 0) 300 if (strncmp(id, ACPI_SIG_MADT, 4) == 0)
@@ -306,7 +307,7 @@ int __init acpi_table_parse(char *id, acpi_tbl_table_handler handler)
306 early_acpi_os_unmap_memory(table, tbl_size); 307 early_acpi_os_unmap_memory(table, tbl_size);
307 return 0; 308 return 0;
308 } else 309 } else
309 return 1; 310 return -ENODEV;
310} 311}
311 312
312/* 313/*
@@ -351,7 +352,7 @@ int __init acpi_table_init(void)
351 352
352 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); 353 status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0);
353 if (ACPI_FAILURE(status)) 354 if (ACPI_FAILURE(status))
354 return 1; 355 return -EINVAL;
355 356
356 check_multiple_madt(); 357 check_multiple_madt();
357 return 0; 358 return 0;