From patchwork Mon Jan 2 09:10:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 9493221 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 2718860414 for ; Mon, 2 Jan 2017 09:12:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 106DC2015F for ; Mon, 2 Jan 2017 09:12:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 03C1525D9E; Mon, 2 Jan 2017 09:12:42 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 8060A2015F for ; Mon, 2 Jan 2017 09:12:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932388AbdABJLe (ORCPT ); Mon, 2 Jan 2017 04:11:34 -0500 Received: from mail-pf0-f180.google.com ([209.85.192.180]:33477 "EHLO mail-pf0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932372AbdABJLc (ORCPT ); Mon, 2 Jan 2017 04:11:32 -0500 Received: by mail-pf0-f180.google.com with SMTP id d2so72589994pfd.0 for ; Mon, 02 Jan 2017 01:11:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=K3jAcq2qMR3CX1dwbH/6/ax33yq8AXxXw0AotUEehbE=; b=SFyom7xX0+LncnF1rrnXXqxWDQV2rxIklxIgRGEDhWR+SIkWqleazp1y5iqaaHdWqA Dp7ZD+BW7mI5G03G15uMib6cH2pgKKJxx0nII4uGpaJXOYnxInCArgOa0uhuhiMgAeoj D5rnGMQcp/O+VykBxxA5XL4MGm0Lijmql3F1I= 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:in-reply-to :references:in-reply-to:references; bh=K3jAcq2qMR3CX1dwbH/6/ax33yq8AXxXw0AotUEehbE=; b=dMk0lupLtYwndVohN1LR7Tr90Q87wSAd80KYkeOLebSNVLUCsxnDhlOckKK+2arS9g gLI6UbYNEjVSvO48833iaMD9IGefm1i++HMx+mM6Xv3LchqOCmB9sa2TJsiTkhsM3Z0s IjCWspLBkgvuY/mgB4MYX88HvPHEhrJE8xoO35nFtmraLDPRtp4rU4/boUmhrUVygulX qRzhsHboxhT1B3AgK6THFb5aIJ1aVsOtbMBVAByUTvccYj4IQTns3NO2OQpMjG2zhiJx IKST8Sqz2gVdy4xnJyC+9TenCKUFqppkwM8Vp2G9Lr8KrqGzSqFzp7nAPnaQe/3ujJlC e/pw== X-Gm-Message-State: AIkVDXLq/0GLvxjensCEUtEXwVkct59EcW93JxWs5Xkw+3pfijudSHgefkfaqleWRTXMWywy X-Received: by 10.84.164.162 with SMTP id w31mr124361521pla.9.1483348286849; Mon, 02 Jan 2017 01:11:26 -0800 (PST) Received: from localhost ([122.172.43.83]) by smtp.gmail.com with ESMTPSA id l11sm130322471pfb.28.2017.01.02.01.11.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 02 Jan 2017 01:11:26 -0800 (PST) From: Viresh Kumar To: Rafael Wysocki , Viresh Kumar , Nishanth Menon , Stephen Boyd Cc: linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Vincent Guittot , Viresh Kumar Subject: [PATCH V3 04/10] PM / OPP: Error out on failing to add static OPPs for v1 bindings Date: Mon, 2 Jan 2017 14:40:58 +0530 Message-Id: X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: References: In-Reply-To: References: 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 The code adding static OPPs for V2 bindings already does so. Make the V1 bindings specific code behave the same. Signed-off-by: Viresh Kumar Reviewed-by: Stephen Boyd --- drivers/base/power/opp/of.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c index f8512ca2bf41..c8fe815774ff 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -433,7 +433,7 @@ static int _of_add_opp_table_v1(struct device *dev) { const struct property *prop; const __be32 *val; - int nr; + int nr, ret; prop = of_find_property(dev->of_node, "operating-points", NULL); if (!prop) @@ -456,9 +456,13 @@ static int _of_add_opp_table_v1(struct device *dev) unsigned long freq = be32_to_cpup(val++) * 1000; unsigned long volt = be32_to_cpup(val++); - if (_opp_add_v1(dev, freq, volt, false)) - dev_warn(dev, "%s: Failed to add OPP %ld\n", - __func__, freq); + ret = _opp_add_v1(dev, freq, volt, false); + if (ret) { + dev_err(dev, "%s: Failed to add OPP %ld (%d)\n", + __func__, freq, ret); + dev_pm_opp_of_remove_table(dev); + return ret; + } nr -= 2; }