aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorViresh Kumar <viresh.kumar@linaro.org>2017-05-23 00:02:12 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-06-21 21:15:30 -0400
commit688a48b0d27000167e0450bc1243e29a560395ca (patch)
treec1cc28e5ce664efed6abad22bcda8c3b1a44d92e
parent478256bddb0323898694bd22acdf42a70d4ff024 (diff)
PM / OPP: opp-microvolt is not optional if regulators are set
If dev_pm_opp_set_regulators() is called for a device and its regulators are set in the OPP core, the OPP nodes for the device must contain the "opp-microvolt" property, otherwise there is something wrong and we better error out. Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Stephen Boyd <sboyd@codeaurora.org> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/base/power/opp/of.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/base/power/opp/of.c b/drivers/base/power/opp/of.c
index 779428676f63..57eec1ca0569 100644
--- a/drivers/base/power/opp/of.c
+++ b/drivers/base/power/opp/of.c
@@ -131,8 +131,14 @@ static int opp_parse_supplies(struct dev_pm_opp *opp, struct device *dev,
131 prop = of_find_property(opp->np, name, NULL); 131 prop = of_find_property(opp->np, name, NULL);
132 132
133 /* Missing property isn't a problem, but an invalid entry is */ 133 /* Missing property isn't a problem, but an invalid entry is */
134 if (!prop) 134 if (!prop) {
135 return 0; 135 if (!opp_table->regulator_count)
136 return 0;
137
138 dev_err(dev, "%s: opp-microvolt missing although OPP managing regulators\n",
139 __func__);
140 return -EINVAL;
141 }
136 } 142 }
137 143
138 vcount = of_property_count_u32_elems(opp->np, name); 144 vcount = of_property_count_u32_elems(opp->np, name);