linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver.
@ 2017-06-29 16:50 Enric Balletbo i Serra
  2017-06-29 16:50 ` [PATCH v2 2/2] thermal: core: Allow to disable polling when disabling thermal zone Enric Balletbo i Serra
  2017-06-30  2:40 ` [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver Zhang Rui
  0 siblings, 2 replies; 6+ messages in thread
From: Enric Balletbo i Serra @ 2017-06-29 16:50 UTC (permalink / raw)
  To: Zhang Rui, rjw, Len Brown, linux-acpi, linux-kernel
  Cc: Guenter Roeck, Sameer Nanda

Use thermal_set_mode instead of just set the tz_enable variable when
enabling the ACPI thermal driver. The purpose of this change is trigger
a thermal_zone_device_update when driver switches from disabled to
enabled mode so thermal_zone data is up-to-date.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
---
This patch is new from v1 [1]

[1] https://patchwork.kernel.org/patch/9804229/

 drivers/acpi/thermal.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c
index 1d0417b..9949458 100644
--- a/drivers/acpi/thermal.c
+++ b/drivers/acpi/thermal.c
@@ -930,7 +930,9 @@ static int acpi_thermal_register_thermal_zone(struct acpi_thermal *tz)
 	if (ACPI_FAILURE(status))
 		return -ENODEV;
 
-	tz->tz_enabled = 1;
+	result = thermal_set_mode(tz->thermal_zone, THERMAL_DEVICE_ENABLED);
+	if (result)
+		return result;
 
 	dev_info(&tz->device->dev, "registered as thermal_zone%d\n",
 		 tz->thermal_zone->id);
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-07-01  3:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-29 16:50 [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver Enric Balletbo i Serra
2017-06-29 16:50 ` [PATCH v2 2/2] thermal: core: Allow to disable polling when disabling thermal zone Enric Balletbo i Serra
2017-06-30  5:05   ` Zhang Rui
2017-06-30  8:15     ` Enric Balletbo Serra
2017-07-01  3:06       ` Zhang Rui
2017-06-30  2:40 ` [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver Zhang Rui

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).