CLOCKSOURCE: mips-gic: Enable the clock before using it
[linux-drm-fsl-dcu.git] / drivers / clocksource / mips-gic-timer.c
index b81ed1a5342d90ca7481dd48c0bf928da5bcc6e7..913585d93466af0f19a4cb54f2fe1eb3241bb8ce 100644 (file)
@@ -158,8 +158,13 @@ static void __init gic_clocksource_of_init(struct device_node *node)
 
        clk = of_clk_get(node, 0);
        if (!IS_ERR(clk)) {
+               if (clk_prepare_enable(clk) < 0) {
+                       pr_err("GIC failed to enable clock\n");
+                       clk_put(clk);
+                       return;
+               }
+
                gic_frequency = clk_get_rate(clk);
-               clk_put(clk);
        } else if (of_property_read_u32(node, "clock-frequency",
                                        &gic_frequency)) {
                pr_err("GIC frequency not specified.\n");