lkml.org 
[lkml]   [2014]   [Jul]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
SubjectRe: [PATCH 06/14] cpufreq: cpu0: defer probe if clock isn't registered yet
From
On 3 July 2014 06:08, Stephen Boyd <sboyd@codeaurora.org> wrote:
> Please make this a dev_dbg() or just remove it entirely. Sending a
> message to the log on probe defer just duplicates what the driver core
> is already doing.

Updated as:

Author: Viresh Kumar <viresh.kumar@linaro.org>
Date: Thu Jun 26 10:40:21 2014 +0530

cpufreq: cpu0: print relevant error when we defer probe

Currently, we defer probe if regulator_get() returned -EPROBE_DEFER, i.e.
regulator isn't registered yet. We do a dev_err() in this case. Sending a
message to the log on probe defer just duplicates what the driver core is
already doing. Convert it to dev_dbg() instead.

We should defer in case of clk_get() as well.

Current code already does it, but it wasn't intentional probably.
Its just that
we are returning the right error with wrong print message.

Fix print message to convey right error.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
drivers/cpufreq/cpufreq-cpu0.c | 13 +++++++++++--
1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-cpu0.c b/drivers/cpufreq/cpufreq-cpu0.c
index 4273a5f..8a1166c 100644
--- a/drivers/cpufreq/cpufreq-cpu0.c
+++ b/drivers/cpufreq/cpufreq-cpu0.c
@@ -140,7 +140,7 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
* not yet registered, we should try defering probe.
*/
if (PTR_ERR(cpu_reg) == -EPROBE_DEFER) {
- dev_err(cpu_dev, "cpu0 regulator not ready, retry\n");
+ dev_dbg(cpu_dev, "cpu0 regulator not ready, retry\n");
ret = -EPROBE_DEFER;
goto out_put_node;
}
@@ -151,7 +151,16 @@ static int cpu0_cpufreq_probe(struct platform_device *pdev)
cpu_clk = clk_get(cpu_dev, NULL);
if (IS_ERR(cpu_clk)) {
ret = PTR_ERR(cpu_clk);
- pr_err("failed to get cpu0 clock: %d\n", ret);
+
+ /*
+ * If cpu's clk node is present, but clock is not yet
+ * registered, we should try defering probe.
+ */
+ if (ret == -EPROBE_DEFER)
+ dev_dbg(cpu_dev, "cpu0 clock not ready, retry\n");
+ else
+ dev_err(cpu_dev, "failed to get cpu0 clock: %d\n", ret);
+
goto out_put_reg;
}

\
 
 \ /
  Last update: 2014-07-03 05:01    [W:0.222 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site