Message ID | 1b5cac826c60d6fe06146acf8f9377de8729fb1d.1480401041.git.viresh.kumar@linaro.org |
---|---|
State | Superseded |
Headers | show |
diff --git a/drivers/base/power/opp/core.c b/drivers/base/power/opp/core.c index 3c9f223709ab..f7a5fb4dbf11 100644 --- a/drivers/base/power/opp/core.c +++ b/drivers/base/power/opp/core.c @@ -748,7 +748,20 @@ int dev_pm_opp_set_rate(struct device *dev, unsigned long target_freq) /* Only frequency scaling */ if (!regulators) { + unsigned long u_volt = opp->supplies[0].u_volt; + rcu_read_unlock(); + + /* + * DT contained supply ratings? Consider platform failed to set + * regulators. + */ + if (unlikely(u_volt)) { + dev_err(dev, "%s: Regulator not registered with OPP core\n", + __func__); + return -EINVAL; + } + return _generic_set_opp_clk_only(dev, clk, old_freq, freq); }