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


Groups > linux.kernel > #1647614 > unrolled thread

[PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set

Started byViresh Kumar <viresh.kumar@linaro.org>
First post2017-05-23 06:10 +0200
Last post2017-05-23 23:10 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set Viresh Kumar <viresh.kumar@linaro.org> - 2017-05-23 06:10 +0200
    Re: [PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if  regulators are set Stephen Boyd <sboyd@codeaurora.org> - 2017-05-23 23:10 +0200

#1647614 — [PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set

FromViresh Kumar <viresh.kumar@linaro.org>
Date2017-05-23 06:10 +0200
Subject[PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set
Message-ID<tK9iV-6tR-3@gated-at.bofh.it>
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>
---
 drivers/base/power/opp/of.c | 10 ++++++++--
 1 file 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,
 		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);
-- 
2.13.0.70.g6367777092d9

[toc] | [next] | [standalone]


#1648685 — Re: [PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set

FromStephen Boyd <sboyd@codeaurora.org>
Date2017-05-23 23:10 +0200
SubjectRe: [PATCH V2 3/4] PM / OPP: opp-microvolt is not optional if regulators are set
Message-ID<tKpe2-rD-27@gated-at.bofh.it>
In reply to#1647614
On 05/23, Viresh Kumar wrote:
> 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>

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
a Linux Foundation Collaborative Project

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web