patch-2.4.10 linux/drivers/acpi/ospm/ec/ecspace.c

Next file: linux/drivers/acpi/ospm/ec/ectransx.c
Previous file: linux/drivers/acpi/ospm/ec/ecmain.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/ospm/ec/ecspace.c linux/drivers/acpi/ospm/ec/ecspace.c
@@ -1,7 +1,7 @@
 /*****************************************************************************
  *
  * Module Name: ecspace.c
- *   $Revision: 20 $
+ *   $Revision: 22 $
  *
  *****************************************************************************/
 
@@ -43,9 +43,9 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 ec_space_setup (
-	ACPI_HANDLE		region_handle,
+	acpi_handle		region_handle,
 	u32			function,
 	void			*handler_context,
 	void			**return_context)
@@ -66,7 +66,7 @@
  *
  * PARAMETERS:  function            - Read or Write operation
  *              address             - Where in the space to read or write
- *              bit_width           - Field width in bits (8, 16, or 32)
+ *              bit_width           - Field width in bits (should be 8)
  *              value               - Pointer to in or out value
  *              context             - context pointer
  *
@@ -77,7 +77,7 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 ec_space_handler (
 	u32                     function,
 	ACPI_PHYSICAL_ADDRESS   address,
@@ -86,12 +86,14 @@
 	void                    *handler_context,
 	void                    *region_context)
 {
-	ACPI_STATUS             status = AE_OK;
+	acpi_status             status = AE_OK;
 	EC_CONTEXT              *ec = NULL;
 	EC_REQUEST              ec_request;
 
+	FUNCTION_TRACE("ec_space_handler");
+
 	if (address > 0xFF || bit_width != 8 || !value || !handler_context) {
-		return(AE_BAD_PARAMETER);
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
 	ec = (EC_CONTEXT*)handler_context;
@@ -111,7 +113,8 @@
 		break;
 
 	default:
-		return(AE_BAD_PARAMETER);
+		ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "Received request with invalid function [%p].\n", function));
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
 		break;
 	}
 
@@ -123,7 +126,7 @@
 		(*value) = (u32)ec_request.data;
 	}
 
-	return(status);
+	return_ACPI_STATUS(status);
 }
 
 
@@ -139,20 +142,22 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 ec_install_space_handler (
 	EC_CONTEXT              *ec)
 {
-	ACPI_STATUS             status = AE_OK;
+	acpi_status             status = AE_OK;
+
+	FUNCTION_TRACE("ec_install_space_handler");
 
 	if (!ec) {
-		return(AE_BAD_PARAMETER);
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
 	status = acpi_install_address_space_handler (ec->acpi_handle,
 		ACPI_ADR_SPACE_EC, &ec_space_handler, &ec_space_setup, ec);
 	
-	return(status);
+	return_ACPI_STATUS(status);
 }
 
 
@@ -168,18 +173,20 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 ec_remove_space_handler (
 	EC_CONTEXT              *ec)
 {
-	ACPI_STATUS             status = AE_OK;
+	acpi_status             status = AE_OK;
+
+	FUNCTION_TRACE("ec_remove_space_handler");
 
 	if (!ec) {
-		return(AE_BAD_PARAMETER);
+		return_ACPI_STATUS(AE_BAD_PARAMETER);
 	}
 
 	status = acpi_remove_address_space_handler(ec->acpi_handle,
 		ACPI_ADR_SPACE_EC, &ec_space_handler);
 
-	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)