include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[safe/jmp/linux-2.6] / drivers / clocksource / sh_tmu.c
index d6ea439..fc9ff1e 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/clocksource.h>
 #include <linux/clockchips.h>
 #include <linux/sh_timer.h>
+#include <linux/slab.h>
 
 struct sh_tmu_priv {
        void __iomem *mapbase;
@@ -138,6 +139,9 @@ static void sh_tmu_disable(struct sh_tmu_priv *p)
        /* disable channel */
        sh_tmu_start_stop_ch(p, 0);
 
+       /* disable interrupts in TMU block */
+       sh_tmu_write(p, TCR, 0x0000);
+
        /* stop clock */
        clk_disable(p->clk);
 }
@@ -158,7 +162,7 @@ static void sh_tmu_set_next(struct sh_tmu_priv *p, unsigned long delta,
        if (periodic)
                sh_tmu_write(p, TCOR, delta);
        else
-               sh_tmu_write(p, TCOR, 0);
+               sh_tmu_write(p, TCOR, 0xffffffff);
 
        sh_tmu_write(p, TCNT, delta);
 
@@ -320,15 +324,15 @@ static void sh_tmu_register_clockevent(struct sh_tmu_priv *p,
        ced->set_next_event = sh_tmu_clock_event_next;
        ced->set_mode = sh_tmu_clock_event_mode;
 
+       pr_info("sh_tmu: %s used for clock events\n", ced->name);
+       clockevents_register_device(ced);
+
        ret = setup_irq(p->irqaction.irq, &p->irqaction);
        if (ret) {
                pr_err("sh_tmu: failed to request irq %d\n",
                       p->irqaction.irq);
                return;
        }
-
-       pr_info("sh_tmu: %s used for clock events\n", ced->name);
-       clockevents_register_device(ced);
 }
 
 static int sh_tmu_register(struct sh_tmu_priv *p, char *name,
@@ -385,7 +389,6 @@ static int sh_tmu_setup(struct sh_tmu_priv *p, struct platform_device *pdev)
        p->irqaction.dev_id = p;
        p->irqaction.irq = irq;
        p->irqaction.flags = IRQF_DISABLED | IRQF_TIMER | IRQF_IRQPOLL;
-       p->irqaction.mask = CPU_MASK_NONE;
 
        /* get hold of clock */
        p->clk = clk_get(&p->pdev->dev, cfg->clk);