From patchwork Thu May 24 10:32:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 136730 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp2015733lji; Thu, 24 May 2018 03:33:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoved5rWUqRDnXHZh3ca9g1HSDDQGIsUJw4gWFhWQoWNoKoKymZ+QnE3uiZ4Rpx5RSW5bQq X-Received: by 2002:a17:902:bd82:: with SMTP id q2-v6mr6715148pls.77.1527157983607; Thu, 24 May 2018 03:33:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527157983; cv=none; d=google.com; s=arc-20160816; b=G6DievKpWYmgo8vDCUCUGQUYkkFcv3bypaK5D2qVxfGn9fqaq1JeufCPWhu/DTdKBZ tLiRJNyZxrPe6cvrzFxucmOV7gUS4QYrCVCw2m7GxKGmq/oKeBu+E2HigBPLhYijOt5n xbfYW79r5gW6+lP86flowl14DU4zTfUnf578jkwST7/EF+CGDMNFbgPv75ZGvzIxZUMY UGNjIOX0XNdnAgPRBln6YYEWnigBqt8XkMwsAAGGIrFaLN1bd71UJKdFn43e/MFsZGRy lHt2KL/h3Y0HIeucDsN+9B4hE24WFW/wZomgtlu0YUpupaA9aA3pfTxYiERTzKk6FLdJ 9zDg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=JWcbzbGWf9ap6uPjai7Xbghk4UVFulvoNihzbWETQH8=; b=h7pu5NyPH/2Al49BbtbMJxSdboCGJPR09QLO5BBkJu6dxfYCo4cTQB9jYcUSydTg7A IeyD2NmKILw5xvzOrwmg5vQ/69RmSFbLc5aT1ykD5lYASt8Lw7reFfN0M+HzCdF3UDcA nom4vz5jiPVC5kWxnLevgcQX9VEyRwdaRux4Lb3/MQlVCBc1GVOrVWtvVAP00A+aU52+ G1Pwf5Qk/vah6YJ9cZP9yBqKHhP+6wXOJBKpC7J1JBNlbyQ2OFn8pfsN73iNm7t9pAc2 ifYtJWH9ehU9PVhvcY2nY7TIHUq4ygfqTJO0pZJvKLO7TOVa+eKnxT4tWQlxmA7RIxFR DLlA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=NIs7PHin; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d65-v6si21402008pfa.263.2018.05.24.03.33.03; Thu, 24 May 2018 03:33:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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=@linaro.org header.s=google header.b=NIs7PHin; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030941AbeEXKcs (ORCPT + 10 others); Thu, 24 May 2018 06:32:48 -0400 Received: from mail-pf0-f195.google.com ([209.85.192.195]:35016 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S968476AbeEXKcp (ORCPT ); Thu, 24 May 2018 06:32:45 -0400 Received: by mail-pf0-f195.google.com with SMTP id x9-v6so670550pfm.2 for ; Thu, 24 May 2018 03:32:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=JWcbzbGWf9ap6uPjai7Xbghk4UVFulvoNihzbWETQH8=; b=NIs7PHin8OrxBwrCpMEReVSttA93S3hyVNw1Fm21QrBzJxC7AtcMF/zOPHBB8wNiO1 2zWiha8DFlCvg/BRsdGg8dGyLp5gKEVuW8h11G3kEnf/253fiJxIBVsuY2JHE6nJ3GX0 CgDJoZkOpapL9IOoLq3i3NA3pJOiCRnKonvbo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JWcbzbGWf9ap6uPjai7Xbghk4UVFulvoNihzbWETQH8=; b=KQ0J2rMX3QmTy3kVGYXi9F9POIVyC2N/rLjg5yWQ5Y0Ecgg+tDRm7A2YfwUiICJr8h MzWXWBph8eOtNqqdMH5BMNIKTu7gjCQVIq1HnYZq9nWgVJ8uynM2iM5KwFy/ZPu4MbAQ oelG2gArWb2AN1OrMC+wX+oi4HuEVYQZ9HRnAiJ3GCyuU85PnMRao1Oo6jhCFIaJI4sy jjjoc6eLXToNFBqAymiQwV4hRfj/Frqqz12l/+v9shJqITjr4Yr1nQJq2evVG90tRn30 o4nRxXfCvzG5nHStBgyzGnL8PTxsRjsybuxCjjmmFf/F3tq8gSAlMmQMDhoqeJuoGbFI mUFQ== X-Gm-Message-State: ALKqPwfCMlfEHPIsQ+ux+e+gwa4/lHAnU3DON+2ejhwX8D2wTTVaNKzl yVXoMXTUHX/XATXijUoGQ+c4GQ== X-Received: by 2002:a62:e408:: with SMTP id r8-v6mr6684569pfh.172.1527157964631; Thu, 24 May 2018 03:32:44 -0700 (PDT) Received: from localhost ([122.172.112.176]) by smtp.gmail.com with ESMTPSA id y18-v6sm45225806pfi.104.2018.05.24.03.32.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 May 2018 03:32:43 -0700 (PDT) From: Viresh Kumar To: Rafael Wysocki , Kevin Hilman , Ulf Hansson , Len Brown , Pavel Machek Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rajendra Nayak Subject: [PATCH V2] PM / Domain: Return 0 on error from of_genpd_opp_to_performance_state() Date: Thu, 24 May 2018 16:02:40 +0530 Message-Id: <2be9323571538a7c78656c5bb4ba6eb76b2d7b8f.1527157905.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.15.0.194.g9af6a3dea062 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org of_genpd_opp_to_performance_state() should return 0 on errors, as its doc comment describes. While it follows that mostly, it returns a negative error number on one of the failures. Fix that. Fixes: 6e41766a6a50 ("PM / Domain: Implement of_genpd_opp_to_performance_state()") Reported-by: Rajendra Nayak Signed-off-by: Viresh Kumar Acked-by: Ulf Hansson --- V2: s/%d/%ld to fix the warning which I missed in V1. drivers/base/power/domain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.15.0.194.g9af6a3dea062 diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index 29e25dc0584c..e30d4528aef2 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -2446,7 +2446,8 @@ unsigned int of_genpd_opp_to_performance_state(struct device *dev, opp = of_dev_pm_opp_find_required_opp(&genpd->dev, opp_node); if (IS_ERR(opp)) { - state = PTR_ERR(opp); + dev_err(dev, "Failed to find required OPP: %ld\n", + PTR_ERR(opp)); goto unlock; }