From patchwork Tue Aug 11 06:57:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 52283 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by patches.linaro.org (Postfix) with ESMTPS id 0AA2222EC4 for ; Tue, 11 Aug 2015 06:57:52 +0000 (UTC) Received: by wicja10 with SMTP id ja10sf21180472wic.2 for ; Mon, 10 Aug 2015 23:57:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:date:from:to:cc:subject:message-id :references:mime-version:content-type:content-disposition :in-reply-to:user-agent:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=c7oTC7mCDTeUVPbJchM5/oblL09BlXJOf2+pCQ+l3ng=; b=UNQMouCceZYyd2sLxMFEpjhVeDlB8W/VpnTP2M8cz3ySKxBxFRXP5GLzRAA6CQD3y1 PYSI4LO2/UdD3KRIYzGWT4amVWNg5lYILq5DSbRkbGYTqprhE5cmcUBsiOjaIi/g2DO7 L14rb3EYLj+7mqAVLrgFBGEoV3XNr2CQQotwlnu6Ki4kIO6NF/UiBRx6it9NzZMGPlwj yElKEbYRw2g2rVBuJni8WgiE1Vn6/+RG3XCP7IiBxSqWYPdEWdHS8PDCvNxxiRE1AIj1 a+qA791tk6OQ9ITpeFoELaJxfWColXIpw1rbcI+3/t/VctwHg599E0YFn12Q7kvp+23g OfDA== X-Gm-Message-State: ALoCoQmBgIs8x6amGmxkOcal6HG3d8j0dXkFg7g4a9K78H6evjZd3v2ve4OA+MlImd+51dUgE2Hw X-Received: by 10.112.119.166 with SMTP id kv6mr6424168lbb.3.1439276271003; Mon, 10 Aug 2015 23:57:51 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.7.146 with SMTP id j18ls767643laa.44.gmail; Mon, 10 Aug 2015 23:57:50 -0700 (PDT) X-Received: by 10.112.168.102 with SMTP id zv6mr24979597lbb.45.1439276270727; Mon, 10 Aug 2015 23:57:50 -0700 (PDT) Received: from mail-la0-f43.google.com (mail-la0-f43.google.com. [209.85.215.43]) by mx.google.com with ESMTPS id vs3si628782lac.153.2015.08.10.23.57.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Aug 2015 23:57:50 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) client-ip=209.85.215.43; Received: by lagz9 with SMTP id z9so65744232lag.3 for ; Mon, 10 Aug 2015 23:57:50 -0700 (PDT) X-Received: by 10.112.129.137 with SMTP id nw9mr18505851lbb.19.1439276270433; Mon, 10 Aug 2015 23:57:50 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.7.198 with SMTP id l6csp2330427lba; Mon, 10 Aug 2015 23:57:49 -0700 (PDT) X-Received: by 10.70.140.195 with SMTP id ri3mr1283611pdb.64.1439276268462; Mon, 10 Aug 2015 23:57:48 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ju17si1770468pab.94.2015.08.10.23.57.47; Mon, 10 Aug 2015 23:57:48 -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; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933731AbbHKG5q (ORCPT + 12 others); Tue, 11 Aug 2015 02:57:46 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:32816 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933728AbbHKG5p (ORCPT ); Tue, 11 Aug 2015 02:57:45 -0400 Received: by pabyb7 with SMTP id yb7so123739646pab.0 for ; Mon, 10 Aug 2015 23:57:44 -0700 (PDT) X-Received: by 10.68.116.176 with SMTP id jx16mr53219647pbb.3.1439276264473; Mon, 10 Aug 2015 23:57:44 -0700 (PDT) Received: from localhost ([223.227.191.36]) by smtp.gmail.com with ESMTPSA id ra10sm1265663pab.19.2015.08.10.23.57.42 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Mon, 10 Aug 2015 23:57:43 -0700 (PDT) Date: Tue, 11 Aug 2015 12:27:38 +0530 From: Viresh Kumar To: Stephen Boyd Cc: Rafael Wysocki , nm@ti.com, linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, khilman@linaro.org, Greg Kroah-Hartman , Len Brown , open list , Pavel Machek Subject: Re: [PATCH 2/6] PM / OPP: restructure _of_init_opp_table_v2() Message-ID: <20150811065738.GE5147@linux> References: <804c420eb23e70448c3c2c93f867a0eab3536bfd.1439187821.git.viresh.kumar@linaro.org> <20150810192336.GC9678@codeaurora.org> <20150811002342.GD5766@linux> <55C9425B.4060207@codeaurora.org> <20150811022546.GL5766@linux> <20150811060855.GH9678@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20150811060855.GH9678@codeaurora.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-pm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: viresh.kumar@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.43 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , On 10-08-15, 23:08, Stephen Boyd wrote: > On 08/11, Viresh Kumar wrote: > > On 10-08-15, 17:31, Stephen Boyd wrote: > > > So ret is 0. I thought it was an error path, but I guess this is a > > > warning path and we return 0 still? > > > > Urg .. > > Oh I see this is an existing problem... Same problem goes for the > count check. It may be better to fix those two cases first and > then do this cleanup. But I don't mind either way. -------------------------8<------------------------- Message-Id: From: Viresh Kumar Date: Tue, 11 Aug 2015 12:22:07 +0530 Subject: [PATCH] PM / OPP: Return proper errors on failure We are returning 0 by mistake, fix it. Signed-off-by: Viresh Kumar --- drivers/base/power/opp.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-pm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index 1daaa1a418a2..be3356a3a452 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -1292,14 +1292,18 @@ static int _of_init_opp_table_v2(struct device *dev, } /* There should be one of more OPP defined */ - if (WARN_ON(!count)) + if (WARN_ON(!count)) { + ret = -ENOENT; goto out; + } if (!ret) { if (!dev_opp) { dev_opp = _find_device_opp(dev); - if (WARN_ON(!dev_opp)) + if (WARN_ON(!dev_opp)) { + ret = -ENOENT; goto out; + } } dev_opp->np = opp_np;