aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86/kernel/mfgpt_32.c14
-rw-r--r--include/asm-x86/geode.h2
2 files changed, 6 insertions, 10 deletions
diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c
index 586228140b9e..186bd3649108 100644
--- a/arch/x86/kernel/mfgpt_32.c
+++ b/arch/x86/kernel/mfgpt_32.c
@@ -30,14 +30,12 @@
30 30
31#include <linux/kernel.h> 31#include <linux/kernel.h>
32#include <linux/interrupt.h> 32#include <linux/interrupt.h>
33#include <linux/module.h>
34#include <asm/geode.h> 33#include <asm/geode.h>
35 34
36#define F_AVAIL 0x01 35#define F_AVAIL 0x01
37 36
38static struct mfgpt_timer_t { 37static struct mfgpt_timer_t {
39 int flags; 38 int flags;
40 struct module *owner;
41} mfgpt_timers[MFGPT_MAX_TIMERS]; 39} mfgpt_timers[MFGPT_MAX_TIMERS];
42 40
43/* Selected from the table above */ 41/* Selected from the table above */
@@ -182,15 +180,14 @@ int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable)
182 return 0; 180 return 0;
183} 181}
184 182
185static int mfgpt_get(int timer, struct module *owner) 183static int mfgpt_get(int timer)
186{ 184{
187 mfgpt_timers[timer].flags &= ~F_AVAIL; 185 mfgpt_timers[timer].flags &= ~F_AVAIL;
188 mfgpt_timers[timer].owner = owner;
189 printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer); 186 printk(KERN_INFO "geode-mfgpt: Registered timer %d\n", timer);
190 return timer; 187 return timer;
191} 188}
192 189
193int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner) 190int geode_mfgpt_alloc_timer(int timer, int domain)
194{ 191{
195 int i; 192 int i;
196 193
@@ -203,7 +200,7 @@ int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner)
203 /* Try to find an available timer */ 200 /* Try to find an available timer */
204 for (i = 0; i < MFGPT_MAX_TIMERS; i++) { 201 for (i = 0; i < MFGPT_MAX_TIMERS; i++) {
205 if (mfgpt_timers[i].flags & F_AVAIL) 202 if (mfgpt_timers[i].flags & F_AVAIL)
206 return mfgpt_get(i, owner); 203 return mfgpt_get(i);
207 204
208 if (i == 5 && domain == MFGPT_DOMAIN_WORKING) 205 if (i == 5 && domain == MFGPT_DOMAIN_WORKING)
209 break; 206 break;
@@ -211,7 +208,7 @@ int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner)
211 } else { 208 } else {
212 /* If they requested a specific timer, try to honor that */ 209 /* If they requested a specific timer, try to honor that */
213 if (mfgpt_timers[timer].flags & F_AVAIL) 210 if (mfgpt_timers[timer].flags & F_AVAIL)
214 return mfgpt_get(timer, owner); 211 return mfgpt_get(timer);
215 } 212 }
216 213
217 /* No timers available - too bad */ 214 /* No timers available - too bad */
@@ -324,8 +321,7 @@ static int __init mfgpt_timer_setup(void)
324 int timer, ret; 321 int timer, ret;
325 u16 val; 322 u16 val;
326 323
327 timer = geode_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING, 324 timer = geode_mfgpt_alloc_timer(MFGPT_TIMER_ANY, MFGPT_DOMAIN_WORKING);
328 THIS_MODULE);
329 if (timer < 0) { 325 if (timer < 0) {
330 printk(KERN_ERR 326 printk(KERN_ERR
331 "mfgpt-timer: Could not allocate a MFPGT timer\n"); 327 "mfgpt-timer: Could not allocate a MFPGT timer\n");
diff --git a/include/asm-x86/geode.h b/include/asm-x86/geode.h
index 811fe14f70b2..c4482753a358 100644
--- a/include/asm-x86/geode.h
+++ b/include/asm-x86/geode.h
@@ -209,7 +209,7 @@ static inline u16 geode_mfgpt_read(int timer, u16 reg)
209extern int __init geode_mfgpt_detect(void); 209extern int __init geode_mfgpt_detect(void);
210extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable); 210extern int geode_mfgpt_toggle_event(int timer, int cmp, int event, int enable);
211extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable); 211extern int geode_mfgpt_set_irq(int timer, int cmp, int irq, int enable);
212extern int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner); 212extern int geode_mfgpt_alloc_timer(int timer, int domain);
213 213
214#define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1) 214#define geode_mfgpt_setup_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 1)
215#define geode_mfgpt_release_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 0) 215#define geode_mfgpt_release_irq(t, c, i) geode_mfgpt_set_irq((t), (c), (i), 0)