FreeBSD/sys/contrib/dev/acpica/compiler/aslmaputils.c
/*******************************************************************************
 *
 * FUNCTION:    MpGetParentDeviceHid
 *
 * PARAMETERS:  Op                      - Parse Op to be examined
 *              TargetNode              - Where the field node is returned
 *              ParentDeviceName        - Where the node path is returned
 *
 * RETURN:      _HID string. Never NULL.
 *
 * DESCRIPTION: Find the parent Device or Scope Op, get the full pathname to
 *              the parent, and get the _HID associated with the parent.
 *
 ******************************************************************************/
MpGetParentDeviceHid
PARAMETERS:  Op                      - Parse Op to be examined
TargetNode              - Where the field node is returned
ParentDeviceName        - Where the node path is returned

_HID string. Never NULL.

Find the parent Device or Scope Op, get the full pathname to
the parent, and get the _HID associated with the parent.
MpGetParentDeviceHid PARAMETERS : Op - Parse Op to be examined TargetNode - Where the field node is returned ParentDeviceName - Where the node path is returned _HID string . Never NULL . Find the parent Device or Scope Op get the full pathname to the parent and get the _HID associated with the parent .
char *
MpGetParentDeviceHid (
    ACPI_PARSE_OBJECT       *Op,
    ACPI_NAMESPACE_NODE     **TargetNode,
    char                    **ParentDeviceName)
{
    ACPI_NAMESPACE_NODE     *DeviceNode;
    while (Op &&
        (Op->Asl.AmlOpcode != AML_DEVICE_OP) &&
        (Op->Asl.AmlOpcode != AML_SCOPE_OP))
    {
        Op = Op->Asl.Parent;
    }
    if (!Op)
    {
        FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Parent_Device ");
        goto ErrorExit;
    }
    DeviceNode = Op->Asl.Node;
    if (!DeviceNode)
    {
        FlPrintFile (ASL_FILE_MAP_OUTPUT, " No_Device_Node ");
        goto ErrorExit;
    }
    *ParentDeviceName = AcpiNsGetExternalPathname (DeviceNode);
    return (MpGetHidValue (DeviceNode));
ErrorExit:
    return ("-No HID-");
}
char * MpGetParentDeviceHid ( ACPI_PARSE_OBJECT * Op , ACPI_NAMESPACE_NODE * * TargetNode , char * * ParentDeviceName ) { ACPI_NAMESPACE_NODE * DeviceNode ; while ( Op && ( Op -> Asl . AmlOpcode != AML_DEVICE_OP ) && ( Op -> Asl . AmlOpcode != AML_SCOPE_OP ) ) { Op = Op -> Asl . Parent ; } if ( ! Op ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " ) ; goto ErrorExit ; } DeviceNode = Op -> Asl . Node ; if ( ! DeviceNode ) { FlPrintFile ( ASL_FILE_MAP_OUTPUT , " " ) ; goto ErrorExit ; } * ParentDeviceName = AcpiNsGetExternalPathname ( DeviceNode ) ; return ( MpGetHidValue ( DeviceNode ) ) ; ErrorExit : return ( " " ) ; }
FUNCTION:    MpGetParentDeviceHid
 PARAMETERS:  Op                      - Parse Op to be examined
              TargetNode              - Where the field node is returned
              ParentDeviceName        - Where the node path is returned
FUNCTION : MpGetParentDeviceHid PARAMETERS : Op - Parse Op to be examined TargetNode - Where the field node is returned ParentDeviceName - Where the node path is returned
/* Find parent Device() or Scope() Op */ /* Get the full pathname to the device and the _HID */