diff mbox series

s3: use system suspend default if --s3-sleep-type is not used

Message ID 20220112173507.947912-1-alex.hung@canonical.com
State Accepted
Headers show
Series s3: use system suspend default if --s3-sleep-type is not used | expand

Commit Message

Alex Hung Jan. 12, 2022, 5:35 p.m. UTC
Buglink: https://bugs.launchpad.net/bugs/1956914

Signed-off-by: Alex Hung <alex.hung@canonical.com>
---
 src/acpi/s3/s3.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

ivanhu Jan. 17, 2022, 4:04 a.m. UTC | #1
On 1/13/22 1:35 AM, Alex Hung wrote:
> Buglink: https://bugs.launchpad.net/bugs/1956914
> 
> Signed-off-by: Alex Hung <alex.hung@canonical.com>
> ---
>  src/acpi/s3/s3.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
> index 45007df4..8b1c3ed1 100644
> --- a/src/acpi/s3/s3.c
> +++ b/src/acpi/s3/s3.c
> @@ -76,10 +76,8 @@ static int s3_init(fwts_framework *fw)
>  		strncpy(sleep_type_orig, "deep", strlen("deep") + 1);
>  	}
>  
> -	if (!s3_sleep_type) {
> -		if (fwts_set(PM_SUSPEND_PATH, "deep") != FWTS_OK)
> -			fwts_log_error(fw, "Cannot set the sleep type to S3(deep), test with default type.");
> -	} else {
> +	if (s3_sleep_type) {
> +		fwts_log_info(fw, "Override system suspend default by '%s'\n", s3_sleep_type);
>  		if (fwts_set(PM_SUSPEND_PATH, s3_sleep_type) != FWTS_OK)
>  			fwts_log_error(fw, "Cannot set the sleep type to %s, test with default type.", s3_sleep_type);
>  	}
> 

Acked-by: Alex Hung <alex.hung@canonical.com>
diff mbox series

Patch

diff --git a/src/acpi/s3/s3.c b/src/acpi/s3/s3.c
index 45007df4..8b1c3ed1 100644
--- a/src/acpi/s3/s3.c
+++ b/src/acpi/s3/s3.c
@@ -76,10 +76,8 @@  static int s3_init(fwts_framework *fw)
 		strncpy(sleep_type_orig, "deep", strlen("deep") + 1);
 	}
 
-	if (!s3_sleep_type) {
-		if (fwts_set(PM_SUSPEND_PATH, "deep") != FWTS_OK)
-			fwts_log_error(fw, "Cannot set the sleep type to S3(deep), test with default type.");
-	} else {
+	if (s3_sleep_type) {
+		fwts_log_info(fw, "Override system suspend default by '%s'\n", s3_sleep_type);
 		if (fwts_set(PM_SUSPEND_PATH, s3_sleep_type) != FWTS_OK)
 			fwts_log_error(fw, "Cannot set the sleep type to %s, test with default type.", s3_sleep_type);
 	}