]> Git Repo - linux.git/blobdiff - drivers/acpi/acpica/evregion.c
ACPICA: Events: Split acpi_ev_associate_reg_method() from region initialization code
[linux.git] / drivers / acpi / acpica / evregion.c
index 19a4e695555fe26b492ee1fa0481ab676c34b9ab..432b81080369e1e13f7d6114156e161b3da00f11 100644 (file)
@@ -527,6 +527,52 @@ acpi_ev_attach_region(union acpi_operand_object *handler_obj,
        return_ACPI_STATUS(AE_OK);
 }
 
+/*******************************************************************************
+ *
+ * FUNCTION:    acpi_ev_associate_reg_method
+ *
+ * PARAMETERS:  region_obj          - Region object
+ *
+ * RETURN:      Status
+ *
+ * DESCRIPTION: Find and associate _REG method to a region
+ *
+ ******************************************************************************/
+
+void acpi_ev_associate_reg_method(union acpi_operand_object *region_obj)
+{
+       acpi_name *reg_name_ptr = (acpi_name *) METHOD_NAME__REG;
+       struct acpi_namespace_node *method_node;
+       struct acpi_namespace_node *node;
+       union acpi_operand_object *region_obj2;
+       acpi_status status;
+
+       ACPI_FUNCTION_TRACE(ev_associate_reg_method);
+
+       region_obj2 = acpi_ns_get_secondary_object(region_obj);
+       if (!region_obj2) {
+               return_VOID;
+       }
+
+       node = region_obj->region.node->parent;
+
+       /* Find any "_REG" method associated with this region definition */
+
+       status =
+           acpi_ns_search_one_scope(*reg_name_ptr, node, ACPI_TYPE_METHOD,
+                                    &method_node);
+       if (ACPI_SUCCESS(status)) {
+               /*
+                * The _REG method is optional and there can be only one per region
+                * definition. This will be executed when the handler is attached
+                * or removed
+                */
+               region_obj2->extra.method_REG = method_node;
+       }
+
+       return_VOID;
+}
+
 /*******************************************************************************
  *
  * FUNCTION:    acpi_ev_execute_reg_method
This page took 0.0342 seconds and 4 git commands to generate.