Skip to contentSkip to conversation

cpufreq: cpufreq-cpu0: Use devm_regulator_get_optional()

PATCH In review Mark Brown 3 participants 4 messages Aug 9, 2013 – Aug 13, 2013 CPU frequency scaling framework

lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/1 cpufreq: cpufreq-cpu0: Use devm_regulator_get_optional()

From: Mark Brown <[email protected]>

Since the cpufreq-cpu0 driver is capable of coping without a software controllable regulator and would be confused by a dummy one it should use devm_regulator_get_optional() to ensure no dummy is provided.

---

devm_regulator_get_optional() is a new API in my tree for -next, is it OK to merge this patch via that branch?

 drivers/cpufreq/cpufreq-cpu0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq-cpu0.c +1 -1
index 09cd3a7..b946ac7 100644
@@ -197,7 +197,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
 	cpu_dev = &pdev->dev;
 	cpu_dev->of_node = np;
 
-	cpu_reg = devm_regulator_get(cpu_dev, "cpu0");
+	cpu_reg = devm_regulator_get_optional(cpu_dev, "cpu0");
 	if (IS_ERR(cpu_reg)) {
 		/*
 		 * If cpu0 regulator supply node is present, but regulator is
Signature · 1 line
1.8.4.rc1
maintainer
#1 lore raw
Quoted 11 lines · Mark Brown

From: Mark Brown <[email protected]>

Since the cpufreq-cpu0 driver is capable of coping without a software controllable regulator and would be confused by a dummy one it should use devm_regulator_get_optional() to ensure no dummy is provided.

---

devm_regulator_get_optional() is a new API in my tree for -next, is it OK to merge this patch via that branch?

I don't see a issue with it, by Rafael has the authority :)

Over that it would have been useful if we could have this patch as part of the series you posted for defining devm_regulator_get_optional(), and so we could have seen what's that patch is doing..

author
#2 lore raw
Quoted 3 lines · Viresh Kumar

Over that it would have been useful if we could have this patch as part of the series you posted for defining devm_regulator_get_optional(), and so we could have seen what's that patch is doing..

It's in -next. There's rather a lot of regulator users in the kernel.

#3 lore raw
In reply to Mark Brown
Quoted 11 lines · Mark Brown

From: Mark Brown <[email protected]>

Since the cpufreq-cpu0 driver is capable of coping without a software controllable regulator and would be confused by a dummy one it should use devm_regulator_get_optional() to ensure no dummy is provided.

---

devm_regulator_get_optional() is a new API in my tree for -next, is it OK to merge this patch via that branch?

Sure, please go ahead.

Thanks,
Rafael

Quoted 17 lines
 drivers/cpufreq/cpufreq-cpu0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/cpufreq-cpu0.c +1 -1
index 09cd3a7..b946ac7 100644
@@ -197,7 +197,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
 	cpu_dev = &pdev->dev;
 	cpu_dev->of_node = np;
 
-	cpu_reg = devm_regulator_get(cpu_dev, "cpu0");
+	cpu_reg = devm_regulator_get_optional(cpu_dev, "cpu0");
 	if (IS_ERR(cpu_reg)) {
 		/*
 		 * If cpu0 regulator supply node is present, but regulator is
Signature · 2 lines
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.