@@ -55,7 +55,7 @@ static u8
acpi_ev_has_default_handler(struct acpi_namespace_node *node,
acpi_adr_space_type space_id);
-static void acpi_ev_orphan_ec_reg_method(void);
+static void acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *node);
static acpi_status
acpi_ev_reg_run(acpi_handle obj_handle,
@@ -1092,7 +1092,7 @@ acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
/* Special case for EC: handle "orphan" _REG methods with no region */
if (space_id == ACPI_ADR_SPACE_EC) {
- acpi_ev_orphan_ec_reg_method();
+ acpi_ev_orphan_ec_reg_method(node);
}
return_ACPI_STATUS(status);
@@ -1161,7 +1161,7 @@ acpi_ev_reg_run(acpi_handle obj_handle,
*
* FUNCTION: acpi_ev_orphan_ec_reg_method
*
- * PARAMETERS: None
+ * PARAMETERS: node - Namespace node for the device
*
* RETURN: None
*
@@ -1180,51 +1180,29 @@ acpi_ev_reg_run(acpi_handle obj_handle,
*
******************************************************************************/
-static void acpi_ev_orphan_ec_reg_method(void)
+static void acpi_ev_orphan_ec_reg_method(struct acpi_namespace_node *node)
{
struct acpi_table_ecdt *table;
acpi_status status;
struct acpi_object_list args;
union acpi_object objects[2];
- struct acpi_namespace_node *ec_device_node;
struct acpi_namespace_node *reg_method;
struct acpi_namespace_node *next_node;
ACPI_FUNCTION_TRACE(ev_orphan_ec_reg_method);
- /* Get the ECDT (if present in system) */
-
- status = acpi_get_table(ACPI_SIG_ECDT, 0,
- ACPI_CAST_INDIRECT_PTR(struct acpi_table_header,
- &table));
- if (ACPI_FAILURE(status)) {
- return_VOID;
- }
-
- /* We need a valid EC_ID string */
-
- if (!(*table->id)) {
+ /* Get the EC node */
+ if (!node)
return_VOID;
- }
/* Namespace is currently locked, must release */
(void)acpi_ut_release_mutex(ACPI_MTX_NAMESPACE);
- /* Get a handle to the EC device referenced in the ECDT */
-
- status = acpi_get_handle(NULL,
- ACPI_CAST_PTR(char, table->id),
- ACPI_CAST_PTR(acpi_handle, &ec_device_node));
- if (ACPI_FAILURE(status)) {
- goto exit;
- }
-
/* Get a handle to a _REG method immediately under the EC device */
- status = acpi_get_handle(ec_device_node,
- METHOD_NAME__REG, ACPI_CAST_PTR(acpi_handle,
- ®_method));
+ status = acpi_get_handle(node, METHOD_NAME__REG,
+ ACPI_CAST_PTR(acpi_handle, ®_method));
if (ACPI_FAILURE(status)) {
goto exit;
}
@@ -1236,14 +1214,14 @@ static void acpi_ev_orphan_ec_reg_method(void)
* with other space IDs to be present; but the code below will then
* execute the _REG method with the EC space ID argument.
*/
- next_node = acpi_ns_get_next_node(ec_device_node, NULL);
+ next_node = acpi_ns_get_next_node(node, NULL);
while (next_node) {
if ((next_node->type == ACPI_TYPE_REGION) &&
(next_node->object) &&
(next_node->object->region.space_id == ACPI_ADR_SPACE_EC)) {
goto exit; /* Do not execute _REG */
}
- next_node = acpi_ns_get_next_node(ec_device_node, next_node);
+ next_node = acpi_ns_get_next_node(node, next_node);
}
/* Evaluate the _REG(EC,Connect) method */