diff options
author | Anson Huang <b20788@freescale.com> | 2012-09-07 09:07:56 +0800 |
---|---|---|
committer | Anson Huang <b20788@freescale.com> | 2012-09-07 09:44:24 +0800 |
commit | 7a9337b348adeb3cc1c959884d5adb37d3a45bf3 (patch) | |
tree | f106ff499772ddb413ea1e5ed05290ab0bdd03cb | |
parent | b387e1ccdaaf6f15a0c40e9738ef6eef0df83253 (diff) |
ENGR00223344 [Thermal]Fix clk enable flow bug
We should make sure clk_enable is called after clk_get.
Signed-off-by: Anson Huang <b20788@freescale.com>
-rw-r--r-- | drivers/mxc/thermal/thermal.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/drivers/mxc/thermal/thermal.c b/drivers/mxc/thermal/thermal.c index f0e961f6109d..0982a7b781bd 100644 --- a/drivers/mxc/thermal/thermal.c +++ b/drivers/mxc/thermal/thermal.c @@ -912,6 +912,13 @@ static int anatop_thermal_probe(struct platform_device *pdev) dev_err(&pdev->dev, "failed to remap anatop calibration data address!\n"); goto anatop_failed; } + + pll3_clk = clk_get(NULL, "pll3_main_clk"); + if (IS_ERR(pll3_clk)) { + retval = -ENOENT; + goto anatop_failed; + } + raw_n40c = DEFAULT_N40C; /* use calibration data to get ratio */ anatop_thermal_counting_ratio(__raw_readl(calibration_addr)); @@ -925,11 +932,6 @@ static int anatop_thermal_probe(struct platform_device *pdev) NULL); thermal_irq = res_irq->start; - pll3_clk = clk_get(NULL, "pll3_main_clk"); - if (IS_ERR(pll3_clk)) { - retval = -ENOENT; - goto anatop_failed; - } anatop_thermal_add(device); anatop_thermal_cpufreq_init(); |