patch-2.4.10 linux/drivers/acpi/utilities/uteval.c

Next file: linux/drivers/acpi/utilities/utglobal.c
Previous file: linux/drivers/acpi/utilities/utdelete.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/utilities/uteval.c linux/drivers/acpi/utilities/uteval.c
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: uteval - Object evaluation
- *              $Revision: 27 $
+ *              $Revision: 30 $
  *
  *****************************************************************************/
 
@@ -50,35 +50,52 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ut_evaluate_numeric_object (
 	NATIVE_CHAR             *object_name,
-	ACPI_NAMESPACE_NODE     *device_node,
-	ACPI_INTEGER            *address)
+	acpi_namespace_node     *device_node,
+	acpi_integer            *address)
 {
-	ACPI_OPERAND_OBJECT     *obj_desc;
-	ACPI_STATUS             status;
+	acpi_operand_object     *obj_desc;
+	acpi_status             status;
+
+
+	FUNCTION_TRACE ("Ut_evaluate_numeric_object");
 
 
 	/* Execute the method */
 
 	status = acpi_ns_evaluate_relative (device_node, object_name, NULL, &obj_desc);
 	if (ACPI_FAILURE (status)) {
+		if (status == AE_NOT_FOUND) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "%s on %4.4s was not found\n",
+				object_name, &device_node->name));
+		}
+		else {
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "%s on %4.4s failed with status %s\n",
+				object_name, &device_node->name,
+				acpi_format_exception (status)));
+		}
 
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 
 	/* Did we get a return object? */
 
 	if (!obj_desc) {
-		return (AE_TYPE);
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from %s\n",
+			object_name));
+		return_ACPI_STATUS (AE_TYPE);
 	}
 
 	/* Is the return object of the correct type? */
 
 	if (obj_desc->common.type != ACPI_TYPE_INTEGER) {
 		status = AE_TYPE;
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Type returned from %s was not a number: %X \n",
+			object_name, obj_desc->common.type));
 	}
 	else {
 		/*
@@ -92,7 +109,7 @@
 
 	acpi_ut_remove_reference (obj_desc);
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -112,13 +129,16 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ut_execute_HID (
-	ACPI_NAMESPACE_NODE     *device_node,
+	acpi_namespace_node     *device_node,
 	ACPI_DEVICE_ID          *hid)
 {
-	ACPI_OPERAND_OBJECT     *obj_desc;
-	ACPI_STATUS             status;
+	acpi_operand_object     *obj_desc;
+	acpi_status             status;
+
+
+	FUNCTION_TRACE ("Ut_execute_HID");
 
 
 	/* Execute the method */
@@ -126,15 +146,24 @@
 	status = acpi_ns_evaluate_relative (device_node,
 			 METHOD_NAME__HID, NULL, &obj_desc);
 	if (ACPI_FAILURE (status)) {
+		if (status == AE_NOT_FOUND) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_HID on %4.4s was not found\n",
+				&device_node->name));
+		}
 
+		else {
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_HID on %4.4s failed %s\n",
+				&device_node->name, acpi_format_exception (status)));
+		}
 
-		return (status);
+		return_ACPI_STATUS (status);
 	}
 
 	/* Did we get a return object? */
 
 	if (!obj_desc) {
-		return (AE_TYPE);
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _HID\n"));
+		return_ACPI_STATUS (AE_TYPE);
 	}
 
 	/*
@@ -144,6 +173,9 @@
 	if ((obj_desc->common.type != ACPI_TYPE_INTEGER) &&
 		(obj_desc->common.type != ACPI_TYPE_STRING)) {
 		status = AE_TYPE;
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Type returned from _HID not a number or string: %s(%X) \n",
+			acpi_ut_get_type_name (obj_desc->common.type), obj_desc->common.type));
 	}
 
 	else {
@@ -165,7 +197,7 @@
 
 	acpi_ut_remove_reference (obj_desc);
 
-	return (status);
+	return_ACPI_STATUS (status);
 }
 
 
@@ -185,13 +217,13 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ut_execute_UID (
-	ACPI_NAMESPACE_NODE     *device_node,
+	acpi_namespace_node     *device_node,
 	ACPI_DEVICE_ID          *uid)
 {
-	ACPI_OPERAND_OBJECT     *obj_desc;
-	ACPI_STATUS             status;
+	acpi_operand_object     *obj_desc;
+	acpi_status             status;
 
 
 	PROC_NAME ("Ut_execute_UID");
@@ -202,7 +234,16 @@
 	status = acpi_ns_evaluate_relative (device_node,
 			 METHOD_NAME__UID, NULL, &obj_desc);
 	if (ACPI_FAILURE (status)) {
+		if (status == AE_NOT_FOUND) {
+			ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "_UID on %4.4s was not found\n",
+				&device_node->name));
+		}
 
+		else {
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"_UID on %4.4s failed %s\n",
+				&device_node->name, acpi_format_exception (status)));
+		}
 
 		return (status);
 	}
@@ -210,6 +251,7 @@
 	/* Did we get a return object? */
 
 	if (!obj_desc) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _UID\n"));
 		return (AE_TYPE);
 	}
 
@@ -220,6 +262,9 @@
 	if ((obj_desc->common.type != ACPI_TYPE_INTEGER) &&
 		(obj_desc->common.type != ACPI_TYPE_STRING)) {
 		status = AE_TYPE;
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+			"Type returned from _UID was not a number or string: %X \n",
+			obj_desc->common.type));
 	}
 
 	else {
@@ -261,13 +306,16 @@
  *
  ******************************************************************************/
 
-ACPI_STATUS
+acpi_status
 acpi_ut_execute_STA (
-	ACPI_NAMESPACE_NODE     *device_node,
+	acpi_namespace_node     *device_node,
 	u32                     *flags)
 {
-	ACPI_OPERAND_OBJECT     *obj_desc;
-	ACPI_STATUS             status;
+	acpi_operand_object     *obj_desc;
+	acpi_status             status;
+
+
+	FUNCTION_TRACE ("Ut_execute_STA");
 
 
 	/* Execute the method */
@@ -275,22 +323,35 @@
 	status = acpi_ns_evaluate_relative (device_node,
 			 METHOD_NAME__STA, NULL, &obj_desc);
 	if (AE_NOT_FOUND == status) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
+			"_STA on %4.4s was not found, assuming present.\n",
+			&device_node->name));
+
 		*flags = 0x0F;
 		status = AE_OK;
 	}
 
+	else if (ACPI_FAILURE (status)) {
+		ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "_STA on %4.4s failed %s\n",
+			&device_node->name,
+			acpi_format_exception (status)));
+	}
 
 	else /* success */ {
 		/* Did we get a return object? */
 
 		if (!obj_desc) {
-			return (AE_TYPE);
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "No object was returned from _STA\n"));
+			return_ACPI_STATUS (AE_TYPE);
 		}
 
 		/* Is the return object of the correct type? */
 
 		if (obj_desc->common.type != ACPI_TYPE_INTEGER) {
 			status = AE_TYPE;
+			ACPI_DEBUG_PRINT ((ACPI_DB_ERROR,
+				"Type returned from _STA was not a number: %X \n",
+				obj_desc->common.type));
 		}
 
 		else {
@@ -304,5 +365,5 @@
 		acpi_ut_remove_reference (obj_desc);
 	}
 
-	return (status);
+	return_ACPI_STATUS (status);
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)