diff options
-rw-r--r-- | arch/x86/kernel/mfgpt_32.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c index 186bd3649108..6f79061cf119 100644 --- a/arch/x86/kernel/mfgpt_32.c +++ b/arch/x86/kernel/mfgpt_32.c | |||
@@ -32,10 +32,8 @@ | |||
32 | #include <linux/interrupt.h> | 32 | #include <linux/interrupt.h> |
33 | #include <asm/geode.h> | 33 | #include <asm/geode.h> |
34 | 34 | ||
35 | #define F_AVAIL 0x01 | ||
36 | |||
37 | static struct mfgpt_timer_t { | 35 | static struct mfgpt_timer_t { |
38 | int flags; | 36 | unsigned int avail:1; |
39 | } mfgpt_timers[MFGPT_MAX_TIMERS]; | 37 | } mfgpt_timers[MFGPT_MAX_TIMERS]; |
40 | 38 | ||
41 | /* Selected from the table above */ | 39 | /* Selected from the table above */ |
@@ -95,7 +93,7 @@ int __init geode_mfgpt_detect(void) | |||
95 | for (i = 0; i < MFGPT_MAX_TIMERS; i++) { | 93 | for (i = 0; i < MFGPT_MAX_TIMERS; i++) { |
96 | val = geode_mfgpt_read(i, MFGPT_REG_SETUP); | 94 | val = geode_mfgpt_read(i, MFGPT_REG_SETUP); |
97 | if (!(val & MFGPT_SETUP_SETUP)) { | 95 | if (!(val & MFGPT_SETUP_SETUP)) { |
98 | mfgpt_timers[i].flags = F_AVAIL; | 96 | mfgpt_timers[i].avail = 1; |
99 | count++; | 97 | count++; |
100 | } | 98 | } |
101 | } | 99 | } |
@@ -182,7 +180,7 @@ int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable) | |||
182 | 180 | ||
183 | static int mfgpt_get(int timer) | 181 | static int mfgpt_get(int timer) |
184 | { | 182 | { |
185 | mfgpt_timers[timer].flags &= ~F_AVAIL; | 183 | mfgpt_timers[timer].avail = 0; |
186 | printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer); | 184 | printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer); |
187 | return timer; | 185 | return timer; |
188 | } | 186 | } |
@@ -199,7 +197,7 @@ int geode_mfgpt_alloc_timer(int timer, int domain) | |||
199 | if (timer < 0) { | 197 | if (timer < 0) { |
200 | /* Try to find an available timer */ | 198 | /* Try to find an available timer */ |
201 | for (i = 0; i < MFGPT_MAX_TIMERS; i++) { | 199 | for (i = 0; i < MFGPT_MAX_TIMERS; i++) { |
202 | if (mfgpt_timers[i].flags & F_AVAIL) | 200 | if (mfgpt_timers[i].avail) |
203 | return mfgpt_get(i); | 201 | return mfgpt_get(i); |
204 | 202 | ||
205 | if (i == 5 && domain == MFGPT_DOMAIN_WORKING) | 203 | if (i == 5 && domain == MFGPT_DOMAIN_WORKING) |
@@ -207,7 +205,7 @@ int geode_mfgpt_alloc_timer(int timer, int domain) | |||
207 | } | 205 | } |
208 | } else { | 206 | } else { |
209 | /* If they requested a specific timer, try to honor that */ | 207 | /* If they requested a specific timer, try to honor that */ |
210 | if (mfgpt_timers[timer].flags & F_AVAIL) | 208 | if (mfgpt_timers[timer].avail) |
211 | return mfgpt_get(timer); | 209 | return mfgpt_get(timer); |
212 | } | 210 | } |
213 | 211 | ||