From patchwork Tue Dec 6 09:15:56 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 86716 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1917136qgi; Tue, 6 Dec 2016 01:17:00 -0800 (PST) X-Received: by 10.84.215.148 with SMTP id l20mr134319757pli.120.1481015820251; Tue, 06 Dec 2016 01:17:00 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 33si18742786plo.92.2016.12.06.01.17.00; Tue, 06 Dec 2016 01:17:00 -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 S1751998AbcLFJQ6 (ORCPT + 13 others); Tue, 6 Dec 2016 04:16:58 -0500 Received: from mail-pf0-f170.google.com ([209.85.192.170]:33819 "EHLO mail-pf0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752183AbcLFJQv (ORCPT ); Tue, 6 Dec 2016 04:16:51 -0500 Received: by mail-pf0-f170.google.com with SMTP id c4so69639521pfb.1 for ; Tue, 06 Dec 2016 01:16:26 -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=UJXjjtnM/nEP29Nw5pU/QKFxn9IvMNCgl3Kv1qRfwtY=; b=XBta8jbfSrAYXwUjvMNyzQKnCSExH/M+umTAWyJbLffjAEp1cxrFmW5xaVPgHP59H2 rtJXs7MJrqapjdecjN1u3Yp1ivAwLwNfTJTZ1CJ3Qw8e4RsjFm+onK5f79LH4ofPhHmP h5QFqL/WYFW+SRTBTy9P4ifu0fdg3/lHUwCdI= 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=UJXjjtnM/nEP29Nw5pU/QKFxn9IvMNCgl3Kv1qRfwtY=; b=N4mQW+8Txt7e7o3EcliEbIFCA71wvuCeocJUarKm2bvhuFYNf6dDR1WBZuUu9+maWI x+KQ7M3w8nxtAU8EyXKWzkdiER3mxWnLKtXo3F3NsEF/Db5L0NCFYvfUP+Gt8w+HpnVS xjRna9WN8CWpcK5eWXMN/Vpx8OxSaFlHmj09f0TlPQHIO5erHkdPy5IHTM1AsQd+7Zab 9qxkqFUsB+E3NAA1NKKYNdsNHZyi8j9iI/IiIRl8vyZ2LYyX2OkQy0mGCj7NVPfTGRmI VxGT7jjTy0pFo9G4y2VSrdw+xRZCSiT4e/ELTLERh58LxWtgIHuwUR72BGgm1CTr4Jf+ 8fyg== X-Gm-Message-State: AKaTC019HART4fcWtDkQpsaUBBUYFPKT29Es+LOT03kHrJ8WAF+SywX5ph80iExw+XrqMsKg X-Received: by 10.98.72.81 with SMTP id v78mr62217332pfa.104.1481015786225; Tue, 06 Dec 2016 01:16:26 -0800 (PST) Received: from localhost ([122.172.43.83]) by smtp.gmail.com with ESMTPSA id w125sm33197203pfb.8.2016.12.06.01.16.24 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 01:16:25 -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 04/10] PM / OPP: Error out on failing to add static OPPs for v1 bindings Date: Tue, 6 Dec 2016 14:45:56 +0530 Message-Id: <1f876a6d176784f9ab901aea7ff521d53522682d.1481015522.git.viresh.kumar@linaro.org> 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 --- 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 Reviewed-by: Stephen Boyd 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; }