[PATCH 1/2] lib: fwts_acpi_method: gather all object names rather than just method names

Alex Hung alex.hung at canonical.com
Thu Apr 19 02:47:01 UTC 2012


On 04/18/2012 07:41 PM, Colin King wrote:
> From: Colin Ian King<colin.king at canonical.com>
>
> Signed-off-by: Colin Ian King<colin.king at canonical.com>
> ---
>   src/lib/src/fwts_acpi_method.c |   13 +++++++------
>   1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/src/lib/src/fwts_acpi_method.c b/src/lib/src/fwts_acpi_method.c
> index 885c8c8..7a55ccd 100644
> --- a/src/lib/src/fwts_acpi_method.c
> +++ b/src/lib/src/fwts_acpi_method.c
> @@ -110,7 +110,7 @@ static acpi_eval_error  errors[] = {
>   };
>
>
> -static fwts_list *fwts_method_names;
> +static fwts_list *fwts_object_names;
>   static bool fwts_method_initialized = false;
>
>
> @@ -123,7 +123,8 @@ int fwts_method_init(fwts_framework *fw)
>   	if (fwts_acpica_init(fw) != FWTS_OK)
>   		return FWTS_ERROR;
>
> -	fwts_method_names = fwts_acpica_get_object_names(8);
> +	/* Gather all object names */
> +	fwts_object_names = fwts_acpica_get_object_names(0);
>   	fwts_method_initialized = true;
>
>   	return FWTS_OK;
> @@ -138,8 +139,8 @@ int fwts_method_deinit(fwts_framework *fw)
>   	int ret = FWTS_ERROR;
>
>   	if (fwts_method_initialized) {
> -		fwts_list_free(fwts_method_names, free);
> -		fwts_method_names = NULL;
> +		fwts_list_free(fwts_object_names, free);
> +		fwts_object_names = NULL;
>   		ret = fwts_acpica_deinit();
>
>   		fwts_method_initialized = false;
> @@ -155,7 +156,7 @@ int fwts_method_deinit(fwts_framework *fw)
>    */
>   fwts_list *fwts_method_get_names(void)
>   {
> -	return fwts_method_names;
> +	return fwts_object_names;
>   }
>
>   /*
> @@ -167,7 +168,7 @@ char *fwts_method_exists(char *name)
>   	size_t name_len = strlen(name);
>   	fwts_list_link	*item;
>
> -	fwts_list_foreach(item, fwts_method_names) {
> +	fwts_list_foreach(item, fwts_object_names) {
>   		char *method_name = fwts_list_data(char*, item);
>   		size_t len = strlen(method_name);
>

Acked-by: Alex Hung <alex.hung at canonical.com>




More information about the fwts-devel mailing list