From patchwork Wed Dec 7 04:42:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 86954 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp136794qgi; Tue, 6 Dec 2016 20:42:27 -0800 (PST) X-Received: by 10.84.202.12 with SMTP id w12mr144854335pld.156.1481085747519; Tue, 06 Dec 2016 20:42:27 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h67si22465114pfe.48.2016.12.06.20.42.27; Tue, 06 Dec 2016 20:42:27 -0800 (PST) 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=neutral (body hash did not verify) header.i=@linaro.org; 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=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751702AbcLGEm0 (ORCPT + 13 others); Tue, 6 Dec 2016 23:42:26 -0500 Received: from mail-pg0-f43.google.com ([74.125.83.43]:35414 "EHLO mail-pg0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbcLGEm0 (ORCPT ); Tue, 6 Dec 2016 23:42:26 -0500 Received: by mail-pg0-f43.google.com with SMTP id p66so157300573pga.2 for ; Tue, 06 Dec 2016 20:42:25 -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=H4kfFLSdTHpAk8hxxLaYzWfM/Vdrw8f3khQjhhBPbr1QNkOg63a1TWuIPmrfM6IynB 2YnESJHXl2UtDnG2qqr8DouNTUIlH1WZEkTqD5YHBkOHLiW49J2MqvBrqUaddoG1wlWz 3IsEgV7AZzJg+8SfszOryxc/vz9XwBPpOqVdI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; 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=euy7+cxDbols6OfprA9roKXGZRXwAheLY4kYAZOwcMZtSDYPGfSg+DjuLmlFbY1PcK K7PR6Nqg9dqWATu7YWSHN66QxCEyyEu1YYTSJzfLicnLUihxJnfTS1l7Z1n8WsQlvVhm CIygzpTBalKRE6MVfyKJHqqjYam5JWhXvSLQ67lTvKEciaEm8vpni92oNphX7tCDHHtN O0N2Qdh/LUyRTSpVWbRQlIy+/BCgahvCaqlHmN9UzdvxwxCTu3jo/1mob5SxBLekdiQL v7E+wbt8aKe4Cor8pYfgyNM8j3pUneqcWvm92M8hrzqoUb+AWW20/csrLZy/oN5MWoOE 0Z4g== X-Gm-Message-State: AKaTC002aKiPlmNrBeM6hDSXYxxjvBxPOMIQta/Fen7Zvh4IMoanfP7nh65FWfVpTQOjolNG X-Received: by 10.84.137.1 with SMTP id 1mr140868264plm.8.1481085745445; Tue, 06 Dec 2016 20:42:25 -0800 (PST) Received: from localhost ([122.172.43.83]) by smtp.gmail.com with ESMTPSA id x123sm38542679pgb.3.2016.12.06.20.42.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 20:42:24 -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, Vincent Guittot , Viresh Kumar Subject: [PATCH V2 04/10] PM / OPP: Error out on failing to add static OPPs for v1 bindings Date: Wed, 7 Dec 2016 10:12:00 +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 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(-) -- 2.7.1.410.g6faf27b -- 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/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; }