From patchwork Thu Jun 29 16:50:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Enric Balletbo i Serra X-Patchwork-Id: 9817365 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 94525602B1 for ; Thu, 29 Jun 2017 16:50:55 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 870AD286A2 for ; Thu, 29 Jun 2017 16:50:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7BD23287CB; Thu, 29 Jun 2017 16:50:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEA89286A2 for ; Thu, 29 Jun 2017 16:50:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752289AbdF2Qux (ORCPT ); Thu, 29 Jun 2017 12:50:53 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:35220 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752017AbdF2Qux (ORCPT ); Thu, 29 Jun 2017 12:50:53 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: eballetbo) with ESMTPSA id 2EDCF264C0A From: Enric Balletbo i Serra To: Zhang Rui , rjw@rjwysocki.net, Len Brown , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Guenter Roeck , Sameer Nanda Subject: [PATCH v2 1/2] acpi: thermal: update thermal_zone after enable the driver. Date: Thu, 29 Jun 2017 18:50:34 +0200 Message-Id: <20170629165035.23101-1-enric.balletbo@collabora.com> X-Mailer: git-send-email 2.9.3 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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);