From patchwork Fri Sep 23 06:48:01 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 76824 Delivered-To: patch@linaro.org Received: by 10.140.106.72 with SMTP id d66csp411757qgf; Thu, 22 Sep 2016 23:48:16 -0700 (PDT) X-Received: by 10.66.20.168 with SMTP id o8mr9887792pae.27.1474613296221; Thu, 22 Sep 2016 23:48:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id zk10si6358770pac.45.2016.09.22.23.48.15; Thu, 22 Sep 2016 23:48:16 -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; 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 S1757017AbcIWGsO (ORCPT + 14 others); Fri, 23 Sep 2016 02:48:14 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:35777 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756385AbcIWGsN (ORCPT ); Fri, 23 Sep 2016 02:48:13 -0400 Received: by mail-pa0-f46.google.com with SMTP id oz2so37236890pac.2 for ; Thu, 22 Sep 2016 23:48:13 -0700 (PDT) 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; bh=wUTktgPfKXRA1XK5ySnnmR8cPXWn3mLXEzxxBACPzfE=; b=CnYRkDdh2AW5mcWmNPVE/2gsxYZ0HSfAG7u0E4sENfoMpbFv46q2D862UBLqpeALZL 1CF9oH6oFXXja/6DklRKRBpMiPGnexcr54qUbV+/QrgVzwRZlXbadqpcwhacTPHHdaBt 8pNl/tKz8lrxY1XfDKTuCAIWKT5huFfeov9lI= 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; bh=wUTktgPfKXRA1XK5ySnnmR8cPXWn3mLXEzxxBACPzfE=; b=cRfTt6M4suo6qg05DzYxgk1PZnZe5VEOfx8E4T7LAXQq3Z5EqXzCEgNsLsQoTjFYAy Uv2SfYLtqvwEWv9P7vR6D+vRm9kHtvhhLv74VOPGFPY1bMEVWrGbZQEPu3f1EcXoRsMn ueyakfz4UycGKacSHqRH3WIMM2oTI0vF+IPXTPgVYSyEWGzvNf1QVt35pyGgQJZQGV+Q IbXveew3+Vmn79IAqcY8lmrbHXBN5Pmes1dZf8RRg2DE9sFeSRjgXuGZu7oRVhTV0BYb DUMTToRP8bH8A36MMKHQYoF1JkmmVW4wLeSFZJ/C+uQrSCMqWGpKVZpSp1P9E+yYwBwp Ip4w== X-Gm-Message-State: AE9vXwNHe9WnSFSFFq8R8vLte2k2gopBudHZvruWlwlsgTPjdQDAjg0AwSmm/j1kdRcGSj0I X-Received: by 10.66.43.230 with SMTP id z6mr9743436pal.150.1474613292657; Thu, 22 Sep 2016 23:48:12 -0700 (PDT) Received: from localhost ([122.172.39.60]) by smtp.gmail.com with ESMTPSA id i78sm8507624pfj.67.2016.09.22.23.48.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Sep 2016 23:48:11 -0700 (PDT) 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 V2 1/2] PM / OPP: compatible string is not optional Date: Fri, 23 Sep 2016 12:18:01 +0530 Message-Id: <94d3439d2942831fe933f0b5e08baaf4a7ba087d.1474613134.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.7.1.410.g6faf27b In-Reply-To: <483bea3c-a1b4-ce5d-e720-d69fc943ab50@codeaurora.org> References: <483bea3c-a1b4-ce5d-e720-d69fc943ab50@codeaurora.org> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The OPP core code doesn't check for the compatible string today and any faulty binding will go unnoticed. Add a check in OPP core to take care of that. Signed-off-by: Viresh Kumar --- This patch replaces: "[PATCH 1/2] PM / OPP: compatible is an optional property". FWIW, I have checked that none of the current users of operating-points-v2 had this problem and this patch can be merged safely. drivers/base/power/opp/of.c | 5 +++++ 1 file changed, 5 insertions(+) -- 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 1dfd3dd92624..111a5cad9f8a 100644 --- a/drivers/base/power/opp/of.c +++ b/drivers/base/power/opp/of.c @@ -318,6 +318,11 @@ static int _of_add_opp_table_v2(struct device *dev, struct device_node *opp_np) struct opp_table *opp_table; int ret = 0, count = 0; + if (!of_device_is_compatible(opp_np, "operating-points-v2")) { + dev_err(dev, "Not compatible with operating-points-v2\n"); + return -EINVAL; + } + mutex_lock(&opp_table_lock); opp_table = _managed_opp(opp_np);