Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp1629095ybb; Sat, 21 Mar 2020 02:29:23 -0700 (PDT) X-Google-Smtp-Source: ADFU+vuMfj0yTLWY0snASdtKUy7tWko/x+WR9ICXEXec0d2cdYTbBG8UT4lmBdTSkgOid3EIQdG+ X-Received: by 2002:aca:3a83:: with SMTP id h125mr1642873oia.64.1584782963694; Sat, 21 Mar 2020 02:29:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584782963; cv=none; d=google.com; s=arc-20160816; b=N6+L52VIK4yHfux1mWiKIdGKpowlRsX7cpMAkywZyeGfozeoSBHpv/HBsoDhJOpHbN XdtNhJsJeFiQcV2nEvSUGeXA8Kli4oCLEArrNK7UK/lJdDu+8Y68JfAPnIyB2jvxOzBG ngjiQPZZd299O4nKcSvEQt6rFgwExkDT/dYTbt9gpNr8i4q6NTXe7mzeC4Tc9sclGo6k SVNg1yXqbXTf5MhRHOanhMiEmjIsYr/HgJWBYvS1PpIYUkilMkGlu9KTubD4fC78Dy2z SreijxTzRqpXyT2aMyPcF7UaQJcxlkD92BVJipIekOAIgP9xezlNOIfaylNw5MVUeUWM LS4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition:mime-version :message-id:subject:to:from:date:dkim-signature; bh=jIPT36F0dTY6bP/ENRWpZvdT+1C7xjAjzp5qPtZLNQs=; b=IJ8LHGmzAhSFZ0ag0XYkLRWtXlmkrfyq1F6IjrIwn0BtLHFOcMFXsDALWcROBfVZQ6 gR8Si2he307pfHF9HWOZ29/zGqaoxL2S4lma3i9pmvoKe4PWl7NKSLcSg0N2rQbSwOlf nnoCOxLzhBW9QaYv5S0qRXnla0/h2jbVXUJBIbKjXYKPdCpVk+uG8uju6Z/nuM4LZgDP EM038rgELSFyJ4d/r8pAd79KTPqZinJ2rCP/7KjBKpsj7LIa1bkiT/tauSF8bxnsAO+C 8bMSGWWVlSo/BWVT1a0Af3KrKlQplB7zTt3PW8PMTgFcR836p6fnsoBPDeOmDSybKJCr A79w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LNwheuTH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si4853602otn.278.2020.03.21.02.29.12; Sat, 21 Mar 2020 02:29:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=LNwheuTH; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728335AbgCUJ1o (ORCPT + 99 others); Sat, 21 Mar 2020 05:27:44 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:39965 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728214AbgCUJ1o (ORCPT ); Sat, 21 Mar 2020 05:27:44 -0400 Received: by mail-wr1-f68.google.com with SMTP id f3so10261106wrw.7; Sat, 21 Mar 2020 02:27:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=jIPT36F0dTY6bP/ENRWpZvdT+1C7xjAjzp5qPtZLNQs=; b=LNwheuTHavqHvWTE7iMHIo+Z4/RvA00DcrC9VYcYkzhhU3TejrH6w7aAzw7dnl9kYI PHvathUfZVAike6uFd4kSG5FprZmktZEq//4fA1pzL2cnqASfM+Pn34kGHa4Gq/c6iBg 9vIVNkL2YbEOXzB+6ZWtHzwjJpcs3OMYLXhqTkfpGk+O2xtECUl4HhtEBNQJ1nBcGhhm 9LbLMgi+PtTtdmGvXPcLsmWUzpoSQodzGWr0NvmGc/ifFVDmcL4FmHZ7v5MqRJ4r0CoL ZnBJizMjLLbSTC/pSC10HzAvFCAfxkOWLeenqyptDFE5lIa2pLyVJfaajnr5ll1lTaQA nwww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:mime-version :content-disposition; bh=jIPT36F0dTY6bP/ENRWpZvdT+1C7xjAjzp5qPtZLNQs=; b=rTm7jyT7hJDKPbofU8CG83GD7oL6GUoO2wDGsgJ/hLb21/Q5ba8OXLpSUzLZfbz7wc lXA0yVK5kNTBXWRi7LyvLIR5r9oR6QoQrTdi5mdbsASdBG5OVYO7mPZJdPRMkUmoHuoy C0M+3N/ND2YEedBN7wmZbS74Gbcqjn59EWaHfLmaZJjW2JR1IISV610Q7zDfe2paf/MR 0/PD0uJ3HjYvTJYKyMOahjoYWdrq1EHFB6vI4iFtH1O0UDVOUfeD8QBSEK4ak4+FqpT6 8d1mcAGx7H20krY4PeOTWcqBMZD51EBBFvD+XHixh9cf+XVD4JXQHaSRS24RkESO1aIC 04kg== X-Gm-Message-State: ANhLgQ3MxIVd9wqJIXv4pbWfKQJA/uZma1isiTMctgHGt2m8Iq4txQkv v/siTrx4n0YdlCNqt4vizoY= X-Received: by 2002:adf:fa8d:: with SMTP id h13mr16405315wrr.155.1584782862249; Sat, 21 Mar 2020 02:27:42 -0700 (PDT) Received: from macmini.local (181.4.199.77.rev.sfr.net. [77.199.4.181]) by smtp.gmail.com with ESMTPSA id n6sm11549130wmn.13.2020.03.21.02.27.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 21 Mar 2020 02:27:41 -0700 (PDT) Date: Sat, 21 Mar 2020 09:27:40 +0000 From: Willy Wolff To: Amit Daniel Kachhap , Viresh Kumar , Javi Merino , Zhang Rui , Daniel Lezcano , Amit Kucheria , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, "Rafael J.Wysocki" Subject: [PATCH] thermal/drivers/cpufreq_cooling: Fix return of cpufreq_set_cur_state Message-ID: <20200321092740.7vvwfxsebcrznydh@macmini.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The function freq_qos_update_request returns 0 or 1 describing update effectiveness, and a negative error code on failure. However, cpufreq_set_cur_state returns 0 on success or an error code otherwise. Signed-off-by: Willy Wolff --- drivers/thermal/cpufreq_cooling.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/cpufreq_cooling.c b/drivers/thermal/cpufreq_cooling.c index fe83d7a210d4..af55ac08e1bd 100644 --- a/drivers/thermal/cpufreq_cooling.c +++ b/drivers/thermal/cpufreq_cooling.c @@ -431,6 +431,7 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, unsigned long state) { struct cpufreq_cooling_device *cpufreq_cdev = cdev->devdata; + int ret; /* Request state should be less than max_level */ if (WARN_ON(state > cpufreq_cdev->max_level)) @@ -442,8 +443,9 @@ static int cpufreq_set_cur_state(struct thermal_cooling_device *cdev, cpufreq_cdev->cpufreq_state = state; - return freq_qos_update_request(&cpufreq_cdev->qos_req, - get_state_freq(cpufreq_cdev, state)); + ret = freq_qos_update_request(&cpufreq_cdev->qos_req, + get_state_freq(cpufreq_cdev, state)); + return ret < 0 ? ret : 0; } /* Bind cpufreq callbacks to thermal cooling device ops */ -- 2.20.1