]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00223344 [Thermal]Fix clk enable flow bug
authorAnson Huang <b20788@freescale.com>
Fri, 7 Sep 2012 01:07:56 +0000 (09:07 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:23 +0000 (08:35 +0200)
We should make sure clk_enable is called after clk_get.

Signed-off-by: Anson Huang <b20788@freescale.com>
drivers/mxc/thermal/thermal.c

index f0e961f6109d81aa5d1dd8dc0f9f72835aff2b80..0982a7b781bdf4c5f711af50c1a98445b3cadc2e 100644 (file)
@@ -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();