463c463,465
< ACPI_OPERAND_OBJECT *RootObj;
---
> ACPI_OPERAND_OBJECT *ParentObj;
> ACPI_NAMESPACE_NODE *ParentNode;
> ACPI_OBJECT_TYPE Type;
469a472,483
> /*
> * Get the parent node. We cheat by using the NextObject field
> * of the method object descriptor.
> */
> ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
> MethodObj->Method.NextObject);
> Type = AcpiNsGetType (ParentNode);
>
> /* Must clear NextObject (AcpiNsAttachObject needs the field) */
>
> MethodObj->Method.NextObject = NULL;
>
473c487
< Info->PrefixNode = AcpiGbl_RootNode;
---
> Info->PrefixNode = ParentNode;
476c490
< * Get the currently attached root object. Add a reference, because the
---
> * Get the currently attached parent object. Add a reference, because the
478c492
< * the root node.
---
> * the parent node.
480,481c494,498
< RootObj = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
< AcpiUtAddReference (RootObj);
---
> ParentObj = AcpiNsGetAttachedObject (ParentNode);
> if (ParentObj)
> {
> AcpiUtAddReference (ParentObj);
> }
483c500
< /* Install the method (module-level code) in the root node */
---
> /* Install the method (module-level code) in the parent node */
485c502
< Status = AcpiNsAttachObject (AcpiGbl_RootNode, MethodObj,
---
> Status = AcpiNsAttachObject (ParentNode, MethodObj,
492c509
< /* Execute the root node as a control method */
---
> /* Execute the parent node as a control method */
501c518
< AcpiNsDetachObject (AcpiGbl_RootNode);
---
> AcpiNsDetachObject (ParentNode);
503c520
< /* Restore the original root object */
---
> /* Restore the original parent object */
505c522,529
< Status = AcpiNsAttachObject (AcpiGbl_RootNode, RootObj, ACPI_TYPE_DEVICE);
---
> if (ParentObj)
> {
> Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);
> }
> else
> {
> ParentNode->Type = (UINT8) Type;
> }
508c532,535
< AcpiUtRemoveReference (RootObj);
---
> if (ParentObj)
> {
> AcpiUtRemoveReference (ParentObj);
> }
< ACPI_OPERAND_OBJECT *RootObj;
---
> ACPI_OPERAND_OBJECT *ParentObj;
> ACPI_NAMESPACE_NODE *ParentNode;
> ACPI_OBJECT_TYPE Type;
469a472,483
> /*
> * Get the parent node. We cheat by using the NextObject field
> * of the method object descriptor.
> */
> ParentNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE,
> MethodObj->Method.NextObject);
> Type = AcpiNsGetType (ParentNode);
>
> /* Must clear NextObject (AcpiNsAttachObject needs the field) */
>
> MethodObj->Method.NextObject = NULL;
>
473c487
< Info->PrefixNode = AcpiGbl_RootNode;
---
> Info->PrefixNode = ParentNode;
476c490
< * Get the currently attached root object. Add a reference, because the
---
> * Get the currently attached parent object. Add a reference, because the
478c492
< * the root node.
---
> * the parent node.
480,481c494,498
< RootObj = AcpiNsGetAttachedObject (AcpiGbl_RootNode);
< AcpiUtAddReference (RootObj);
---
> ParentObj = AcpiNsGetAttachedObject (ParentNode);
> if (ParentObj)
> {
> AcpiUtAddReference (ParentObj);
> }
483c500
< /* Install the method (module-level code) in the root node */
---
> /* Install the method (module-level code) in the parent node */
485c502
< Status = AcpiNsAttachObject (AcpiGbl_RootNode, MethodObj,
---
> Status = AcpiNsAttachObject (ParentNode, MethodObj,
492c509
< /* Execute the root node as a control method */
---
> /* Execute the parent node as a control method */
501c518
< AcpiNsDetachObject (AcpiGbl_RootNode);
---
> AcpiNsDetachObject (ParentNode);
503c520
< /* Restore the original root object */
---
> /* Restore the original parent object */
505c522,529
< Status = AcpiNsAttachObject (AcpiGbl_RootNode, RootObj, ACPI_TYPE_DEVICE);
---
> if (ParentObj)
> {
> Status = AcpiNsAttachObject (ParentNode, ParentObj, Type);
> }
> else
> {
> ParentNode->Type = (UINT8) Type;
> }
508c532,535
< AcpiUtRemoveReference (RootObj);
---
> if (ParentObj)
> {
> AcpiUtRemoveReference (ParentObj);
> }