diff --git a/sys/dev/acpi/aml/aml_evalobj.c b/sys/dev/acpi/aml/aml_evalobj.c index 41916f694950..b73ef70b5de1 100644 --- a/sys/dev/acpi/aml/aml_evalobj.c +++ b/sys/dev/acpi/aml/aml_evalobj.c @@ -55,7 +55,6 @@ #include "debug.h" #else /* _KERNEL */ -#include #include #endif /* !_KERNEL */ @@ -378,10 +377,9 @@ aml_execute_method(struct aml_environ *env) } union aml_object * -aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) +aml_invoke_method(struct aml_name *name, int argc, union aml_object *argv) { int i; - struct aml_name *name; struct aml_name *tmp; struct aml_environ *env; struct aml_local_stack *stack; @@ -394,7 +392,6 @@ aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) return (NULL); } bzero(env, sizeof(struct aml_environ)); - name = aml_find_from_namespace(aml_get_rootname(), method); if (name != NULL && name->property != NULL && name->property->type == aml_t_method) { @@ -424,3 +421,16 @@ aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) memman_free(aml_memman, memid_aml_environ, env); return (retval); } + +union aml_object * +aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) +{ + struct aml_name *name; + + name = aml_find_from_namespace(aml_get_rootname(), method); + if (name == NULL) { + return (NULL); + } + + return (aml_invoke_method(name, argc, argv)); +} diff --git a/sys/dev/acpi/aml/aml_evalobj.h b/sys/dev/acpi/aml/aml_evalobj.h index 884f30168ef9..9b3de0adc8c8 100644 --- a/sys/dev/acpi/aml/aml_evalobj.h +++ b/sys/dev/acpi/aml/aml_evalobj.h @@ -40,6 +40,8 @@ int aml_eval_name_simple(struct aml_name *, va_list); int aml_objtonum(struct aml_environ *, union aml_object *); struct aml_name *aml_execute_method(struct aml_environ *); +union aml_object *aml_invoke_method(struct aml_name *, + int, union aml_object *); union aml_object *aml_invoke_method_by_name(char *, int, union aml_object *); diff --git a/sys/dev/acpi/aml/aml_obj.c b/sys/dev/acpi/aml/aml_obj.c index 6634d43e12ce..62c443f520e4 100644 --- a/sys/dev/acpi/aml/aml_obj.c +++ b/sys/dev/acpi/aml/aml_obj.c @@ -48,7 +48,6 @@ #include #include #else /* _KERNEL */ -#include #include #endif /* !_KERNEL */ diff --git a/sys/dev/acpi/aml/aml_parse.c b/sys/dev/acpi/aml/aml_parse.c index 560c9104d69d..f98977d3bd62 100644 --- a/sys/dev/acpi/aml/aml_parse.c +++ b/sys/dev/acpi/aml/aml_parse.c @@ -54,7 +54,6 @@ #include "debug.h" #else /* _KERNEL */ -#include #include #endif /* !_KERNEL */ diff --git a/usr.sbin/acpi/amldb/aml/aml_evalobj.c b/usr.sbin/acpi/amldb/aml/aml_evalobj.c index 41916f694950..b73ef70b5de1 100644 --- a/usr.sbin/acpi/amldb/aml/aml_evalobj.c +++ b/usr.sbin/acpi/amldb/aml/aml_evalobj.c @@ -55,7 +55,6 @@ #include "debug.h" #else /* _KERNEL */ -#include #include #endif /* !_KERNEL */ @@ -378,10 +377,9 @@ aml_execute_method(struct aml_environ *env) } union aml_object * -aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) +aml_invoke_method(struct aml_name *name, int argc, union aml_object *argv) { int i; - struct aml_name *name; struct aml_name *tmp; struct aml_environ *env; struct aml_local_stack *stack; @@ -394,7 +392,6 @@ aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) return (NULL); } bzero(env, sizeof(struct aml_environ)); - name = aml_find_from_namespace(aml_get_rootname(), method); if (name != NULL && name->property != NULL && name->property->type == aml_t_method) { @@ -424,3 +421,16 @@ aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) memman_free(aml_memman, memid_aml_environ, env); return (retval); } + +union aml_object * +aml_invoke_method_by_name(char *method, int argc, union aml_object *argv) +{ + struct aml_name *name; + + name = aml_find_from_namespace(aml_get_rootname(), method); + if (name == NULL) { + return (NULL); + } + + return (aml_invoke_method(name, argc, argv)); +} diff --git a/usr.sbin/acpi/amldb/aml/aml_evalobj.h b/usr.sbin/acpi/amldb/aml/aml_evalobj.h index 884f30168ef9..9b3de0adc8c8 100644 --- a/usr.sbin/acpi/amldb/aml/aml_evalobj.h +++ b/usr.sbin/acpi/amldb/aml/aml_evalobj.h @@ -40,6 +40,8 @@ int aml_eval_name_simple(struct aml_name *, va_list); int aml_objtonum(struct aml_environ *, union aml_object *); struct aml_name *aml_execute_method(struct aml_environ *); +union aml_object *aml_invoke_method(struct aml_name *, + int, union aml_object *); union aml_object *aml_invoke_method_by_name(char *, int, union aml_object *); diff --git a/usr.sbin/acpi/amldb/aml/aml_obj.c b/usr.sbin/acpi/amldb/aml/aml_obj.c index 6634d43e12ce..62c443f520e4 100644 --- a/usr.sbin/acpi/amldb/aml/aml_obj.c +++ b/usr.sbin/acpi/amldb/aml/aml_obj.c @@ -48,7 +48,6 @@ #include #include #else /* _KERNEL */ -#include #include #endif /* !_KERNEL */ diff --git a/usr.sbin/acpi/amldb/aml/aml_parse.c b/usr.sbin/acpi/amldb/aml/aml_parse.c index 560c9104d69d..f98977d3bd62 100644 --- a/usr.sbin/acpi/amldb/aml/aml_parse.c +++ b/usr.sbin/acpi/amldb/aml/aml_parse.c @@ -54,7 +54,6 @@ #include "debug.h" #else /* _KERNEL */ -#include #include #endif /* !_KERNEL */