From c1a327adce613ed12db89bf8d3782cba193f4ba6 Mon Sep 17 00:00:00 2001 From: msmith Date: Mon, 9 Jul 2001 21:24:59 +0000 Subject: [PATCH] Whoops; we get an ACPI_OBJECT back from evaluating a method, not an ACPI_OPERAND_OBJECT. Fix this so that the power resource type can be properly checked, and we can get the system level and resource order. --- sys/dev/acpica/acpi_powerres.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/sys/dev/acpica/acpi_powerres.c b/sys/dev/acpica/acpi_powerres.c index d70957b1e352..5effdb31907d 100644 --- a/sys/dev/acpica/acpi_powerres.c +++ b/sys/dev/acpica/acpi_powerres.c @@ -145,7 +145,7 @@ acpi_pwr_register_resource(ACPI_HANDLE res) { ACPI_STATUS status; ACPI_BUFFER buf; - ACPI_OPERAND_OBJECT *obj; + ACPI_OBJECT *obj; struct acpi_powerresource *rp, *srp; FUNCTION_TRACE(__func__); @@ -171,15 +171,13 @@ acpi_pwr_register_resource(ACPI_HANDLE res) goto out; } obj = buf.Pointer; - if (obj->Common.Type != ACPI_TYPE_POWER) { + if (obj->Type != ACPI_TYPE_POWER) { DEBUG_PRINT(TRACE_OBJECTS, ("questionable power resource object %s\n", acpi_name(res))); - /* XXX ACPI CA seems to return ACPI_TYPE_ANY, needs to be fixed */ - rp->ap_systemlevel = 0; - rp->ap_order = 0; - } else { - rp->ap_systemlevel = obj->PowerResource.SystemLevel; - rp->ap_order = obj->PowerResource.ResourceOrder; + status = AE_TYPE; + goto out; } + rp->ap_systemlevel = obj->PowerResource.SystemLevel; + rp->ap_order = obj->PowerResource.ResourceOrder; /* sort the resource into the list */ status = AE_OK;