Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1489788

[PATCH V2 1/2] PM / OPP: compatible string is not optional

From Viresh Kumar <viresh.kumar@linaro.org>
Newsgroups linux.kernel
Subject [PATCH V2 1/2] PM / OPP: compatible string is not optional
Date 2016-09-23 08:50 +0200
Message-ID <skst3-eu-1@gated-at.bofh.it> (permalink)
References <skhR1-1Z0-71@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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 <viresh.kumar@linaro.org>
---
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(+)

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);
-- 
2.7.1.410.g6faf27b

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] PM / OPP: compatible is an optional property Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-21 11:40 +0200
  [PATCH 2/2] PM / OPP: Multiple regulators aren't supported yet Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-21 11:40 +0200
    Re: [PATCH 2/2] PM / OPP: Multiple regulators aren't supported yet Rob Herring <robh@kernel.org> - 2016-09-23 22:00 +0200
      Re: [PATCH 2/2] PM / OPP: Multiple regulators aren't supported yet Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-26 07:10 +0200
  Re: [PATCH 1/2] PM / OPP: compatible is an optional property Stephen Boyd <sboyd@codeaurora.org> - 2016-09-22 21:30 +0200
    Re: [PATCH 1/2] PM / OPP: compatible is an optional property Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-23 07:20 +0200
      Re: [PATCH 1/2] PM / OPP: compatible is an optional property Rob Herring <robh@kernel.org> - 2016-09-23 22:00 +0200
        Re: [PATCH 1/2] PM / OPP: compatible is an optional property Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-26 07:00 +0200
    [PATCH V2 1/2] PM / OPP: compatible string is not optional Viresh Kumar <viresh.kumar@linaro.org> - 2016-09-23 08:50 +0200

csiph-web