aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/dispatcher/dswload.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/acpi/dispatcher/dswload.c')
-rw-r--r--drivers/acpi/dispatcher/dswload.c41
1 files changed, 36 insertions, 5 deletions
diff --git a/drivers/acpi/dispatcher/dswload.c b/drivers/acpi/dispatcher/dswload.c
index a8deb700cf33..35074399c617 100644
--- a/drivers/acpi/dispatcher/dswload.c
+++ b/drivers/acpi/dispatcher/dswload.c
@@ -178,12 +178,12 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
178 * Target of Scope() not found. Generate an External for it, and 178 * Target of Scope() not found. Generate an External for it, and
179 * insert the name into the namespace. 179 * insert the name into the namespace.
180 */ 180 */
181 acpi_dm_add_to_external_list(path); 181 acpi_dm_add_to_external_list(path, ACPI_TYPE_DEVICE, 0);
182 status = 182 status =
183 acpi_ns_lookup(walk_state->scope_info, path, 183 acpi_ns_lookup(walk_state->scope_info, path,
184 object_type, ACPI_IMODE_LOAD_PASS1, 184 object_type, ACPI_IMODE_LOAD_PASS1,
185 ACPI_NS_SEARCH_PARENT, walk_state, 185 ACPI_NS_SEARCH_PARENT, walk_state,
186 &(node)); 186 &node);
187 } 187 }
188#endif 188#endif
189 if (ACPI_FAILURE(status)) { 189 if (ACPI_FAILURE(status)) {
@@ -301,10 +301,41 @@ acpi_ds_load1_begin_op(struct acpi_walk_state * walk_state,
301 status = 301 status =
302 acpi_ns_lookup(walk_state->scope_info, path, object_type, 302 acpi_ns_lookup(walk_state->scope_info, path, object_type,
303 ACPI_IMODE_LOAD_PASS1, flags, walk_state, 303 ACPI_IMODE_LOAD_PASS1, flags, walk_state,
304 &(node)); 304 &node);
305 if (ACPI_FAILURE(status)) { 305 if (ACPI_FAILURE(status)) {
306 ACPI_ERROR_NAMESPACE(path, status); 306 if (status == AE_ALREADY_EXISTS) {
307 return_ACPI_STATUS(status); 307
308 /* The name already exists in this scope */
309
310 if (node->flags & ANOBJ_IS_EXTERNAL) {
311 /*
312 * Allow one create on an object or segment that was
313 * previously declared External
314 */
315 node->flags &= ~ANOBJ_IS_EXTERNAL;
316 node->type = (u8) object_type;
317
318 /* Just retyped a node, probably will need to open a scope */
319
320 if (acpi_ns_opens_scope(object_type)) {
321 status =
322 acpi_ds_scope_stack_push
323 (node, object_type,
324 walk_state);
325 if (ACPI_FAILURE(status)) {
326 return_ACPI_STATUS
327 (status);
328 }
329 }
330 status = AE_OK;
331 }
332 }
333
334 if (ACPI_FAILURE(status)) {
335
336 ACPI_ERROR_NAMESPACE(path, status);
337 return_ACPI_STATUS(status);
338 }
308 } 339 }
309 break; 340 break;
310 } 341 }