ACK: [PATCH] acpi: devices: deiniit acpica when tests are skipped

ivanhu ivan.hu at canonical.com
Wed Oct 11 09:58:13 UTC 2017



On 10/06/2017 08:15 AM, Alex Hung wrote:
> deinit function in fwts_framework_ops is not called when init function
> returns FWTS_SKIP. This patch fixes fwts_acpica_deinit() is not called.
> 
> Signed-off-by: Alex Hung <alex.hung at canonical.com>
> ---
>   src/acpi/devices/ac_adapter/ac.c         | 1 +
>   src/acpi/devices/battery/battery.c       | 1 +
>   src/acpi/devices/battery/smart_battery.c | 1 +
>   src/acpi/devices/ec/ec.c                 | 1 +
>   4 files changed, 4 insertions(+)
> 
> diff --git a/src/acpi/devices/ac_adapter/ac.c b/src/acpi/devices/ac_adapter/ac.c
> index e573c4ba..d0323f24 100644
> --- a/src/acpi/devices/ac_adapter/ac.c
> +++ b/src/acpi/devices/ac_adapter/ac.c
> @@ -57,6 +57,7 @@ static int acpi_ac_init(fwts_framework *fw)
>   
>   	if (!device) {
>   		fwts_log_error(fw, "ACPI AC device does not exist, skipping test");
> +		fwts_acpica_deinit();
>   		return FWTS_SKIP;
>   	} else {
>   		ACPI_BUFFER buffer;
> diff --git a/src/acpi/devices/battery/battery.c b/src/acpi/devices/battery/battery.c
> index ec1322ad..f6922328 100644
> --- a/src/acpi/devices/battery/battery.c
> +++ b/src/acpi/devices/battery/battery.c
> @@ -57,6 +57,7 @@ static int acpi_battery_init(fwts_framework *fw)
>   
>   	if (!device) {
>   		fwts_log_error(fw, "ACPI Battery device does not exist, skipping test");
> +		fwts_acpica_deinit();
>   		return FWTS_SKIP;
>   	} else {
>   		ACPI_BUFFER buffer;
> diff --git a/src/acpi/devices/battery/smart_battery.c b/src/acpi/devices/battery/smart_battery.c
> index 81ecd529..f16f0f44 100644
> --- a/src/acpi/devices/battery/smart_battery.c
> +++ b/src/acpi/devices/battery/smart_battery.c
> @@ -57,6 +57,7 @@ static int smart_battery_init(fwts_framework *fw)
>   
>   	if (!device) {
>   		fwts_log_error(fw, "Smart Battery device does not exist, skipping test");
> +		fwts_acpica_deinit();
>   		return FWTS_SKIP;
>   	} else {
>   		ACPI_BUFFER buffer;
> diff --git a/src/acpi/devices/ec/ec.c b/src/acpi/devices/ec/ec.c
> index a7ff5ded..1ddcbfe5 100644
> --- a/src/acpi/devices/ec/ec.c
> +++ b/src/acpi/devices/ec/ec.c
> @@ -57,6 +57,7 @@ static int acpi_ec_init(fwts_framework *fw)
>   
>   	if (!device) {
>   		fwts_log_error(fw, "ACPI EC device does not exist, skipping test");
> +		fwts_acpica_deinit();
>   		return FWTS_SKIP;
>   	} else {
>   		ACPI_BUFFER buffer;
> 

Acked-by: Ivan Hu <ivan.hu at canonical.com>



More information about the fwts-devel mailing list