diff mbox series

ACPI: PM: Output correct message on target power state

Message ID 20200421075516.23019-1-kai.heng.feng@canonical.com (mailing list archive)
State Mainlined, archived
Headers show
Series ACPI: PM: Output correct message on target power state | expand

Commit Message

Kai-Heng Feng April 21, 2020, 7:55 a.m. UTC
Transitioned power state logged at the end of setting ACPI power.

However, D3cold won't be in the message because state can only be D3hot
at most.

Use target_state to corretly report when power state is D3cold.

Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
---
 drivers/acpi/device_pm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael J. Wysocki April 26, 2020, 4:37 p.m. UTC | #1
On Tuesday, April 21, 2020 9:55:16 AM CEST Kai-Heng Feng wrote:
> Transitioned power state logged at the end of setting ACPI power.
> 
> However, D3cold won't be in the message because state can only be D3hot
> at most.
> 
> Use target_state to corretly report when power state is D3cold.
> 
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@canonical.com>
> ---
>  drivers/acpi/device_pm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
> index b2263ec67b43..5832bc10aca8 100644
> --- a/drivers/acpi/device_pm.c
> +++ b/drivers/acpi/device_pm.c
> @@ -273,13 +273,13 @@ int acpi_device_set_power(struct acpi_device *device, int state)
>   end:
>  	if (result) {
>  		dev_warn(&device->dev, "Failed to change power state to %s\n",
> -			 acpi_power_state_string(state));
> +			 acpi_power_state_string(target_state));
>  	} else {
>  		device->power.state = target_state;
>  		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
>  				  "Device [%s] transitioned to %s\n",
>  				  device->pnp.bus_id,
> -				  acpi_power_state_string(state)));
> +				  acpi_power_state_string(target_state)));
>  	}
>  
>  	return result;
> 

Applied as a fix for 5.7-rc4, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
index b2263ec67b43..5832bc10aca8 100644
--- a/drivers/acpi/device_pm.c
+++ b/drivers/acpi/device_pm.c
@@ -273,13 +273,13 @@  int acpi_device_set_power(struct acpi_device *device, int state)
  end:
 	if (result) {
 		dev_warn(&device->dev, "Failed to change power state to %s\n",
-			 acpi_power_state_string(state));
+			 acpi_power_state_string(target_state));
 	} else {
 		device->power.state = target_state;
 		ACPI_DEBUG_PRINT((ACPI_DB_INFO,
 				  "Device [%s] transitioned to %s\n",
 				  device->pnp.bus_id,
-				  acpi_power_state_string(state)));
+				  acpi_power_state_string(target_state)));
 	}
 
 	return result;