From: Viresh Kumar Date: Tue, 23 May 2017 04:02:12 +0000 (+0530) Subject: PM / OPP: opp-microvolt is not optional if regulators are set X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=688a48b0d27000167e0450bc1243e29a560395ca;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Reviewed-by: Stephen Boyd Signed-off-by: Rafael J. Wysocki --- 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, prop = of_find_property(opp->np, name, NULL); /* Missing property isn't a problem, but an invalid entry is */ - if (!prop) - return 0; + if (!prop) { + if (!opp_table->regulator_count) + return 0; + + dev_err(dev, "%s: opp-microvolt missing although OPP managing regulators\n", + __func__); + return -EINVAL; + } } vcount = of_property_count_u32_elems(opp->np, name);