aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq/cpufreq-cpu0.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-14 09:11:55 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-05-14 09:11:55 -0400
commitd5a2fa27ecd772b51d93a91209205ec4d6ea2da1 (patch)
tree2bf1b2308e05ba9566cf61091e72167708d5a365 /drivers/cpufreq/cpufreq-cpu0.c
parentf722406faae2d073cc1d01063d1123c35425939e (diff)
parentb57ffac5e57bff33dde3cff35dff5c41876a6d12 (diff)
Merge branch 'pm-cpufreq'
* pm-cpufreq: cpufreq / intel_pstate: use vzalloc() instead of vmalloc()/memset(0) cpufreq, ondemand: Remove leftover debug line cpufreq / kirkwood: don't check resource with devm_ioremap_resource cpufreq / intel_pstate: remove #ifdef MODULE compile fence cpufreq / intel_pstate: Remove idle mode PID cpufreq / intel_pstate: fix ffmpeg regression cpufreq / intel_pstate: use lowest requested max performance cpufreq / intel_pstate: remove idle time and duration from sample and calculations cpufreq: Fix incorrect dependecies for ARM SA11xx drivers cpufreq: ARM big LITTLE: Fix Kconfig entries cpufreq: cpufreq-cpu0: Free parent node for error cases cpufreq: cpufreq-cpu0: defer probe when regulator is not ready cpufreq: Issue CPUFREQ_GOV_POLICY_EXIT notifier before dropping policy refcount cpufreq: governors: Fix CPUFREQ_GOV_POLICY_{INIT|EXIT} notifiers cpufreq: ARM big LITTLE: Improve print message cpufreq: ARM big LITTLE: Move cpu_to_cluster() to arm_big_little.h cpufreq: ARM big LITTLE DT: Return CPUFREQ_ETERNAL if clock-latency isn't found cpufreq: ARM big LITTLE DT: Return correct transition latency cpufreq: ARM big LITTLE: Select PM_OPP
Diffstat (limited to 'drivers/cpufreq/cpufreq-cpu0.c')
-rw-r--r--drivers/cpufreq/cpufreq-cpu0.c27
1 files changed, 20 insertions, 7 deletions
diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index 3ab8294eab04..a64eb8b70444 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -189,12 +189,29 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
189 189
190 if (!np) { 190 if (!np) {
191 pr_err("failed to find cpu0 node\n"); 191 pr_err("failed to find cpu0 node\n");
192 return -ENOENT; 192 ret = -ENOENT;
193 goto out_put_parent;
193 } 194 }
194 195
195 cpu_dev = &pdev->dev; 196 cpu_dev = &pdev->dev;
196 cpu_dev->of_node = np; 197 cpu_dev->of_node = np;
197 198
199 cpu_reg = devm_regulator_get(cpu_dev, "cpu0");
200 if (IS_ERR(cpu_reg)) {
201 /*
202 * If cpu0 regulator supply node is present, but regulator is
203 * not yet registered, we should try defering probe.
204 */
205 if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) {
206 dev_err(cpu_dev, "cpu0 regulator not ready, retry\n");
207 ret = -EPROBE_DEFER;
208 goto out_put_node;
209 }
210 pr_warn("failed to get cpu0 regulator: %ld\n",
211 PTR_ERR(cpu_reg));
212 cpu_reg = NULL;
213 }
214
198 cpu_clk = devm_clk_get(cpu_dev, NULL); 215 cpu_clk = devm_clk_get(cpu_dev, NULL);
199 if (IS_ERR(cpu_clk)) { 216 if (IS_ERR(cpu_clk)) {
200 ret = PTR_ERR(cpu_clk); 217 ret = PTR_ERR(cpu_clk);
@@ -202,12 +219,6 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
202 goto out_put_node; 219 goto out_put_node;
203 } 220 }
204 221
205 cpu_reg = devm_regulator_get(cpu_dev, "cpu0");
206 if (IS_ERR(cpu_reg)) {
207 pr_warn("failed to get cpu0 regulator\n");
208 cpu_reg = NULL;
209 }
210
211 ret = of_init_opp_table(cpu_dev); 222 ret = of_init_opp_table(cpu_dev);
212 if (ret) { 223 if (ret) {
213 pr_err("failed to init OPP table: %d\n", ret); 224 pr_err("failed to init OPP table: %d\n", ret);
@@ -264,6 +275,8 @@ out_free_table:
264 opp_free_cpufreq_table(cpu_dev, &freq_table); 275 opp_free_cpufreq_table(cpu_dev, &freq_table);
265out_put_node: 276out_put_node:
266 of_node_put(np); 277 of_node_put(np);
278out_put_parent:
279 of_node_put(parent);
267 return ret; 280 return ret;
268} 281}
269 282