The Linux Kernel Mailing List
 help / color / mirror / Atom feed
* [PATCH] regulator: core: Fix the init of DT defined fixed regulators
@ 2014-05-19 11:12 Alban Bedel
  2014-05-19 14:39 ` Mark Brown
  0 siblings, 1 reply; 6+ messages in thread
From: Alban Bedel @ 2014-05-19 11:12 UTC (permalink / raw)
  To: linux-kernel; +Cc: Mark Brown, Liam Girdwood, Alban Bedel

When a regulator is defined using DT and it has a single voltage the
regulator init always tries to apply this voltage. However this fails
if the regulator isn't settable. So skip this step if the regulator
doesn't provides any set method.

Signed-off-by: Alban Bedel <alban.bedel@avionic-design.de>
---
 drivers/regulator/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index 9a09f3c..e57450f 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -843,7 +843,9 @@ static int machine_constraints_voltage(struct regulator_dev *rdev,
 
 	/* do we need to apply the constraint voltage */
 	if (rdev->constraints->apply_uV &&
-	    rdev->constraints->min_uV == rdev->constraints->max_uV) {
+	    rdev->constraints->min_uV == rdev->constraints->max_uV &&
+	    (rdev->desc->ops->set_voltage ||
+	     rdev->desc->ops->set_voltage_sel)) {
 		ret = _regulator_do_set_voltage(rdev,
 						rdev->constraints->min_uV,
 						rdev->constraints->max_uV);
-- 
1.9.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2014-05-19 16:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-19 11:12 [PATCH] regulator: core: Fix the init of DT defined fixed regulators Alban Bedel
2014-05-19 14:39 ` Mark Brown
2014-05-19 15:25   ` Alban Bedel
2014-05-19 16:18     ` Mark Brown
2014-05-19 16:37       ` Alban Bedel
2014-05-19 16:55         ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox