linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable
@ 2017-05-17  6:42 Arvind Yadav
  2017-05-17  6:45 ` Viresh Kumar
  0 siblings, 1 reply; 3+ messages in thread
From: Arvind Yadav @ 2017-05-17  6:42 UTC (permalink / raw)
  To: rjw, viresh.kumar; +Cc: linux-pm, linux-kernel

Here, Clock enable can failed. So adding an error check for
clk_prepare_enable.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
 drivers/cpufreq/kirkwood-cpufreq.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/cpufreq/kirkwood-cpufreq.c b/drivers/cpufreq/kirkwood-cpufreq.c
index 1b9bcd7..c2dd43f 100644
--- a/drivers/cpufreq/kirkwood-cpufreq.c
+++ b/drivers/cpufreq/kirkwood-cpufreq.c
@@ -127,7 +127,12 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
 		return PTR_ERR(priv.cpu_clk);
 	}
 
-	clk_prepare_enable(priv.cpu_clk);
+	err = clk_prepare_enable(priv.cpu_clk);
+	if (err) {
+		dev_err(priv.dev, "Unable to prepare cpuclk\n");
+		return err;
+	}
+
 	kirkwood_freq_table[0].frequency = clk_get_rate(priv.cpu_clk) / 1000;
 
 	priv.ddr_clk = of_clk_get_by_name(np, "ddrclk");
@@ -137,7 +142,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
 		goto out_cpu;
 	}
 
-	clk_prepare_enable(priv.ddr_clk);
+	err = clk_prepare_enable(priv.ddr_clk);
+	if (err) {
+		dev_err(priv.dev, "Unable to prepare ddrclk\n");
+		goto out_cpu;
+	}
 	kirkwood_freq_table[1].frequency = clk_get_rate(priv.ddr_clk) / 1000;
 
 	priv.powersave_clk = of_clk_get_by_name(np, "powersave");
@@ -146,7 +155,11 @@ static int kirkwood_cpufreq_probe(struct platform_device *pdev)
 		err = PTR_ERR(priv.powersave_clk);
 		goto out_ddr;
 	}
-	clk_prepare_enable(priv.powersave_clk);
+	err = clk_prepare_enable(priv.powersave_clk);
+	if (err) {
+		dev_err(priv.dev, "Unable to prepare powersave clk\n");
+		goto out_ddr;
+	}
 
 	of_node_put(np);
 	np = NULL;
-- 
1.9.1

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

* Re: [PATCH v2] cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable
  2017-05-17  6:42 [PATCH v2] cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable Arvind Yadav
@ 2017-05-17  6:45 ` Viresh Kumar
  2017-05-17  6:49   ` Arvind Yadav
  0 siblings, 1 reply; 3+ messages in thread
From: Viresh Kumar @ 2017-05-17  6:45 UTC (permalink / raw)
  To: Arvind Yadav; +Cc: rjw, linux-pm, linux-kernel

On 17-05-17, 12:12, Arvind Yadav wrote:
> Here, Clock enable can failed. So adding an error check for
> clk_prepare_enable.

You missed my comment for the commit log.

-- 
viresh

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

* Re: [PATCH v2] cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable
  2017-05-17  6:45 ` Viresh Kumar
@ 2017-05-17  6:49   ` Arvind Yadav
  0 siblings, 0 replies; 3+ messages in thread
From: Arvind Yadav @ 2017-05-17  6:49 UTC (permalink / raw)
  To: Viresh Kumar; +Cc: rjw, linux-pm, linux-kernel

Sorry, I missed it. Now I am going to add.

Thanks
-Arvind


On Wednesday 17 May 2017 12:15 PM, Viresh Kumar wrote:
> On 17-05-17, 12:12, Arvind Yadav wrote:
>> Here, Clock enable can failed. So adding an error check for
>> clk_prepare_enable.
> You missed my comment for the commit log.
>

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

end of thread, other threads:[~2017-05-17  6:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-17  6:42 [PATCH v2] cpufreq: kirkwood-cpufreq:- Handle return value of clk_prepare_enable Arvind Yadav
2017-05-17  6:45 ` Viresh Kumar
2017-05-17  6:49   ` Arvind Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).