From patchwork Wed Nov 25 04:07:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 7695081 Return-Path: X-Original-To: patchwork-linux-acpi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0DB7EBF90C for ; Wed, 25 Nov 2015 04:08:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D86252083D for ; Wed, 25 Nov 2015 04:08:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BF21420829 for ; Wed, 25 Nov 2015 04:08:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755059AbbKYEHz (ORCPT ); Tue, 24 Nov 2015 23:07:55 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:36068 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755046AbbKYEHy (ORCPT ); Tue, 24 Nov 2015 23:07:54 -0500 Received: by pacdm15 with SMTP id dm15so43581789pac.3; Tue, 24 Nov 2015 20:07:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=xOdmgWAGki35BfE6jdVw/2jCgazP3EYAcjRgTpwTh68=; b=Weuz6DUfcijPHpiXd1u5uhBTi4Y5idjaFKymAxrxjkOqZ66xQ82w09HR61hcBVLrao AtfIhyvsmDaZEiT5F4xil5+D4PxcM0UFE7iE1orknBt4QykIAyt+vbUzhlAaWz2ZdeHU ToURhgCLpFMmhR5L1IuC88xHCGKNpPaq3Jjg7A/pU6y+cjVVCAiXzHBi8CINCC6zDEld CrWltKUV1cteXtlbA2YHUkdVdLjdff+cpJqdbT8gbMtx3arEUb+vH/w13aTl+SbkLtQn QZIT243imKUaMbndYxhETIxgicoVHsKrPIgUmYKn6QDPPjX1e6tRr6jqx8+1QpnCPiYP GrOQ== X-Received: by 10.67.5.2 with SMTP id ci2mr48284296pad.47.1448424474130; Tue, 24 Nov 2015 20:07:54 -0800 (PST) Received: from localhost ([2601:647:4200:e7fd:3039:30cb:476e:158f]) by smtp.gmail.com with ESMTPSA id l84sm17334553pfb.15.2015.11.24.20.07.51 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 24 Nov 2015 20:07:52 -0800 (PST) From: Eduardo Valentin To: Rui Zhang Cc: LKML , Linux ACPI , Eduardo Valentin , linux-pm@vger.kernel.org Subject: [PATCH 1/1] thermal: setup monitor only once after handling trips Date: Tue, 24 Nov 2015 20:07:48 -0800 Message-Id: <1448424468-18736-1-git-send-email-edubezval@gmail.com> X-Mailer: git-send-email 2.5.0 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Instead of changing the monitoring setup every time after handling each trip, this patch simplifies the monitoring setup by moving the setup call to a place where all trips have been treated already. Cc: Zhang Rui Cc: linux-pm@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Eduardo Valentin --- drivers/thermal/thermal_core.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c index d9e525c..6debb54 100644 --- a/drivers/thermal/thermal_core.c +++ b/drivers/thermal/thermal_core.c @@ -457,11 +457,6 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip) handle_critical_trips(tz, trip, type); else handle_non_critical_trips(tz, trip, type); - /* - * Alright, we handled this trip successfully. - * So, start monitoring again. - */ - monitor_thermal_zone(tz); } /** @@ -547,6 +542,12 @@ void thermal_zone_device_update(struct thermal_zone_device *tz) for (count = 0; count < tz->trips; count++) handle_thermal_trip(tz, count); + + /* + * Alright, we handled this trip successfully. + * So, start monitoring again. + */ + monitor_thermal_zone(tz); } EXPORT_SYMBOL_GPL(thermal_zone_device_update);