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: 10423911 X-Patchwork-Delegate: rjw@sisk.pl 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 2D53C6032C for ; Thu, 24 May 2018 10:33:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1A1FC29265 for ; Thu, 24 May 2018 10:33:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E01F2926B; Thu, 24 May 2018 10:33:04 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI 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 8E55F29265 for ; Thu, 24 May 2018 10:33:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030941AbeEXKcs (ORCPT ); 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-Google-Smtp-Source: AB8JxZqEmA5qLxiGhnJTiD5N/OcG35Hm3D3l5JT05TpT9EW8oHCvMZ/FajaAc6yz5D8jMeg3IjIiqg== 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 X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; }