diff options
| author | Andy Grover <agrover@groveronline.com> | 2003-07-13 02:10:44 -0700 |
|---|---|---|
| committer | Andy Grover <agrover@groveronline.com> | 2003-07-13 02:10:44 -0700 |
| commit | fbdebc89ca92c0ee6e56ab82b6806eaa0a657205 (patch) | |
| tree | 198f1ff937d807cdc8ad0669d120632b68ab1831 | |
| parent | 5fdd86aea63d3fbe8283a9ccdd9db4ee64f1626e (diff) | |
ACPI: Parse SSDTs in order discovered, as opposed to reverse order (Hrvoje Habjanic)
| -rw-r--r-- | drivers/acpi/tables/tbinstal.c | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/drivers/acpi/tables/tbinstal.c b/drivers/acpi/tables/tbinstal.c index a96c5de2bfeb..8ab152398483 100644 --- a/drivers/acpi/tables/tbinstal.c +++ b/drivers/acpi/tables/tbinstal.c @@ -271,22 +271,40 @@ acpi_tb_init_table_descriptor ( if (list_head->next) { return_ACPI_STATUS (AE_ALREADY_EXISTS); } - } - /* - * Link the new table in to the list of tables of this type. - * Just insert at the start of the list, order unimportant. - * - * table_desc->Prev is already NULL from calloc() - */ - table_desc->next = list_head->next; - list_head->next = table_desc; + table_desc->next = list_head->next; + list_head->next = table_desc; - if (table_desc->next) { - table_desc->next->prev = table_desc; + if (table_desc->next) { + table_desc->next->prev = table_desc; + } + + list_head->count++; } + else { + /* + * Link the new table in to the list of tables of this type. + * Insert at the end of the list, order IS IMPORTANT. + * + * table_desc->Prev & Next are already NULL from calloc() + */ + list_head->count++; + + if (!list_head->next) { + list_head->next = table_desc; + } + else { + table_desc->next = list_head->next; - list_head->count++; + while (table_desc->next->next) { + table_desc->next = table_desc->next->next; + } + + table_desc->next->next = table_desc; + table_desc->prev = table_desc->next; + table_desc->next = NULL; + } + } /* Finish initialization of the table descriptor */ |
