aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/mfgpt_32.c
diff options
context:
space:
mode:
authorAndres Salomon <dilinger@debian.org>2008-02-09 17:24:08 -0500
committerThomas Gleixner <tglx@linutronix.de>2008-02-09 17:24:08 -0500
commit9501b2efd70ad3957a70d44de54dab7c52f9b882 (patch)
tree9824e865bdd40a88e434c51a0807a9c67cc39402 /arch/x86/kernel/mfgpt_32.c
parentfa28e067c3b8af96c79c060e163b1387c172ae75 (diff)
x86: GEODE: MFGPT: replace 'flags' field with 'avail' bit
Drop F_AVAIL and the 'flags' field, replacing with an 'avail' bit. This looks more understandable to me. Signed-off-by: Andres Salomon <dilinger@debian.org> Signed-off-by: Jordan Crouse <jordan.crouse@amd.com> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/kernel/mfgpt_32.c')
-rw-r--r--arch/x86/kernel/mfgpt_32.c12
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
37static struct mfgpt_timer_t { 35static 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
183static int mfgpt_get(int timer) 181static 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