diff options
Diffstat (limited to 'arch/mips/kernel/cevt-gt641xx.c')
-rw-r--r-- | arch/mips/kernel/cevt-gt641xx.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/mips/kernel/cevt-gt641xx.c b/arch/mips/kernel/cevt-gt641xx.c index 4c651b2680f9..c36772631fe0 100644 --- a/arch/mips/kernel/cevt-gt641xx.c +++ b/arch/mips/kernel/cevt-gt641xx.c | |||
@@ -49,10 +49,9 @@ int gt641xx_timer0_state(void) | |||
49 | static int gt641xx_timer0_set_next_event(unsigned long delta, | 49 | static int gt641xx_timer0_set_next_event(unsigned long delta, |
50 | struct clock_event_device *evt) | 50 | struct clock_event_device *evt) |
51 | { | 51 | { |
52 | unsigned long flags; | ||
53 | u32 ctrl; | 52 | u32 ctrl; |
54 | 53 | ||
55 | spin_lock_irqsave(>641xx_timer_lock, flags); | 54 | spin_lock(>641xx_timer_lock); |
56 | 55 | ||
57 | ctrl = GT_READ(GT_TC_CONTROL_OFS); | 56 | ctrl = GT_READ(GT_TC_CONTROL_OFS); |
58 | ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); | 57 | ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); |
@@ -61,7 +60,7 @@ static int gt641xx_timer0_set_next_event(unsigned long delta, | |||
61 | GT_WRITE(GT_TC0_OFS, delta); | 60 | GT_WRITE(GT_TC0_OFS, delta); |
62 | GT_WRITE(GT_TC_CONTROL_OFS, ctrl); | 61 | GT_WRITE(GT_TC_CONTROL_OFS, ctrl); |
63 | 62 | ||
64 | spin_unlock_irqrestore(>641xx_timer_lock, flags); | 63 | spin_unlock(>641xx_timer_lock); |
65 | 64 | ||
66 | return 0; | 65 | return 0; |
67 | } | 66 | } |
@@ -69,10 +68,9 @@ static int gt641xx_timer0_set_next_event(unsigned long delta, | |||
69 | static void gt641xx_timer0_set_mode(enum clock_event_mode mode, | 68 | static void gt641xx_timer0_set_mode(enum clock_event_mode mode, |
70 | struct clock_event_device *evt) | 69 | struct clock_event_device *evt) |
71 | { | 70 | { |
72 | unsigned long flags; | ||
73 | u32 ctrl; | 71 | u32 ctrl; |
74 | 72 | ||
75 | spin_lock_irqsave(>641xx_timer_lock, flags); | 73 | spin_lock(>641xx_timer_lock); |
76 | 74 | ||
77 | ctrl = GT_READ(GT_TC_CONTROL_OFS); | 75 | ctrl = GT_READ(GT_TC_CONTROL_OFS); |
78 | ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); | 76 | ctrl &= ~(GT_TC_CONTROL_ENTC0_MSK | GT_TC_CONTROL_SELTC0_MSK); |
@@ -90,7 +88,7 @@ static void gt641xx_timer0_set_mode(enum clock_event_mode mode, | |||
90 | 88 | ||
91 | GT_WRITE(GT_TC_CONTROL_OFS, ctrl); | 89 | GT_WRITE(GT_TC_CONTROL_OFS, ctrl); |
92 | 90 | ||
93 | spin_unlock_irqrestore(>641xx_timer_lock, flags); | 91 | spin_unlock(>641xx_timer_lock); |
94 | } | 92 | } |
95 | 93 | ||
96 | static void gt641xx_timer0_event_handler(struct clock_event_device *dev) | 94 | static void gt641xx_timer0_event_handler(struct clock_event_device *dev) |
@@ -133,9 +131,9 @@ static int __init gt641xx_timer0_clockevent_init(void) | |||
133 | 131 | ||
134 | cd = >641xx_timer0_clockevent; | 132 | cd = >641xx_timer0_clockevent; |
135 | cd->rating = 200 + gt641xx_base_clock / 10000000; | 133 | cd->rating = 200 + gt641xx_base_clock / 10000000; |
134 | clockevent_set_clock(cd, gt641xx_base_clock); | ||
136 | cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); | 135 | cd->max_delta_ns = clockevent_delta2ns(0x7fffffff, cd); |
137 | cd->min_delta_ns = clockevent_delta2ns(0x300, cd); | 136 | cd->min_delta_ns = clockevent_delta2ns(0x300, cd); |
138 | clockevent_set_clock(cd, gt641xx_base_clock); | ||
139 | 137 | ||
140 | clockevents_register_device(>641xx_timer0_clockevent); | 138 | clockevents_register_device(>641xx_timer0_clockevent); |
141 | 139 | ||