From patchwork Fri May 16 10:51:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chander Kashyap X-Patchwork-Id: 30322 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ig0-f200.google.com (mail-ig0-f200.google.com [209.85.213.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 5DCA1202E4 for ; Fri, 16 May 2014 10:52:00 +0000 (UTC) Received: by mail-ig0-f200.google.com with SMTP id uy17sf1941427igb.7 for ; Fri, 16 May 2014 03:51:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=/EHI/x/LCoCEYwvFe6RFrAIT7FeW3aHz/j41VjxohxQ=; b=XWrsBN4gzSBAcp+/TfhAx0YlwueSjGDoEG+VRral/4VGMK8+2XkETHyrcA4XnfL2S0 rlYIbWro+/Pg/y2YsJFthfb2+rA6aPq2T7So3Lekt1HTYiVrNwyVBcTeVKhkD5BjN/2f +PeKu1ve7WKOuzKzXdpzKzHNxo+Lv8J93+NVwGMQYfSbgHvHSpif3S+tkUUyB6YUErrq /TFKmMDNamgOqa7vxlB36X4hFJx9ZViecPNhy0cokTo/NbkLamhfXmSXk/bTpll+PpZj zK2BdJL+/y70rO9yFVHxVvrdbdtE06zODxwTnxdJsHn82swvRfsN846KXYysouCeieKl FtgA== X-Gm-Message-State: ALoCoQkScM5bBK0OButjWnKJP1AyLzfGpbfn8OsIJJ3/NLAVVxziGOP0D8uH4i85bPsCjISCAmY6 X-Received: by 10.183.1.7 with SMTP id bc7mr7895158obd.47.1400237519585; Fri, 16 May 2014 03:51:59 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.41.166 with SMTP id z35ls611745qgz.93.gmail; Fri, 16 May 2014 03:51:59 -0700 (PDT) X-Received: by 10.58.219.166 with SMTP id pp6mr13039132vec.1.1400237519437; Fri, 16 May 2014 03:51:59 -0700 (PDT) Received: from mail-ve0-f169.google.com (mail-ve0-f169.google.com [209.85.128.169]) by mx.google.com with ESMTPS id uv3si1480754vdc.113.2014.05.16.03.51.59 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 03:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.128.169 as permitted sender) client-ip=209.85.128.169; Received: by mail-ve0-f169.google.com with SMTP id jx11so2858243veb.14 for ; Fri, 16 May 2014 03:51:59 -0700 (PDT) X-Received: by 10.220.92.193 with SMTP id s1mr460413vcm.34.1400237519339; Fri, 16 May 2014 03:51:59 -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.220.221.72 with SMTP id ib8csp41999vcb; Fri, 16 May 2014 03:51:58 -0700 (PDT) X-Received: by 10.69.26.103 with SMTP id ix7mr19604713pbd.41.1400237518579; Fri, 16 May 2014 03:51:58 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id rb6si8592810pab.73.2014.05.16.03.51.57; Fri, 16 May 2014 03:51:57 -0700 (PDT) Received-SPF: none (google.com: linux-pm-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757091AbaEPKv4 (ORCPT + 12 others); Fri, 16 May 2014 06:51:56 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:48839 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756904AbaEPKv4 (ORCPT ); Fri, 16 May 2014 06:51:56 -0400 Received: by mail-pa0-f47.google.com with SMTP id lf10so2415062pab.34 for ; Fri, 16 May 2014 03:51:55 -0700 (PDT) X-Received: by 10.66.228.37 with SMTP id sf5mr20076597pac.19.1400237515786; Fri, 16 May 2014 03:51:55 -0700 (PDT) Received: from localhost.localdomain ([14.140.216.146]) by mx.google.com with ESMTPSA id yj6sm33137971pab.19.2014.05.16.03.51.51 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 16 May 2014 03:51:54 -0700 (PDT) From: Chander Kashyap To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: nm@ti.com, rjw@rjwysocki.net, pavel@ucw.cz, len.brown@intel.com, gregkh@linuxfoundation.org, viresh.kumar@linaro.org, Chander Kashyap , Chander Kashyap , Inderpal Singh Subject: [PATCH] PM / OPP: fix incorrect OPP count handling in of_init_opp_table Date: Fri, 16 May 2014 16:21:17 +0530 Message-Id: <1400237477-24831-1-git-send-email-chander.kashyap@linaro.org> X-Mailer: git-send-email 1.7.9.5 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: chander.kashyap@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.128.169 as permitted sender) smtp.mail=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: , In of_init_opp_table function, if a failure to add an OPP is detected, the count of OPPs, yet to be added is not updated. Fix this by decrementing this count on failure as well. Signed-off-by: Chander Kashyap Signed-off-by: Inderpal Singh Acked-by: Viresh Kumar Acked-by: Nishanth Menon --- drivers/base/power/opp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/base/power/opp.c b/drivers/base/power/opp.c index d9e376a..faae9cf 100644 --- a/drivers/base/power/opp.c +++ b/drivers/base/power/opp.c @@ -643,11 +643,9 @@ int of_init_opp_table(struct device *dev) unsigned long freq = be32_to_cpup(val++) * 1000; unsigned long volt = be32_to_cpup(val++); - if (dev_pm_opp_add(dev, freq, volt)) { + if (dev_pm_opp_add(dev, freq, volt)) dev_warn(dev, "%s: Failed to add OPP %ld\n", __func__, freq); - continue; - } nr -= 2; }