From: Anson Huang Date: Fri, 7 Sep 2012 01:07:56 +0000 (+0800) Subject: ENGR00223344 [Thermal]Fix clk enable flow bug X-Git-Tag: v3.0.35-fsl~491 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=e7baf482839f468d5e0fa2aa2d6ae94b93e53969;p=karo-tx-linux.git ENGR00223344 [Thermal]Fix clk enable flow bug We should make sure clk_enable is called after clk_get. Signed-off-by: Anson Huang --- 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();