diff options
author | Steven Rostedt <rostedt@goodmis.org> | 2006-01-09 18:59:26 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@hera.kernel.org> | 2006-01-09 18:59:26 -0500 |
commit | 3fe0c2776113c24b4b30374003f934cf44280db5 (patch) | |
tree | 0b0039205fd82fb7da94370be23e2634757573c1 /drivers/char/watchdog | |
parent | 906c3b75f6c09b4693a20387aaa6aaa50d327082 (diff) |
[PATCH] mutex subsystem, semaphore to completion: CPU3WDT
change CPU3WDT semaphores to completions.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/char/watchdog')
-rw-r--r-- | drivers/char/watchdog/cpu5wdt.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/char/watchdog/cpu5wdt.c b/drivers/char/watchdog/cpu5wdt.c index e75045fe2641..3e8410b5a65e 100644 --- a/drivers/char/watchdog/cpu5wdt.c +++ b/drivers/char/watchdog/cpu5wdt.c | |||
@@ -28,6 +28,7 @@ | |||
28 | #include <linux/init.h> | 28 | #include <linux/init.h> |
29 | #include <linux/ioport.h> | 29 | #include <linux/ioport.h> |
30 | #include <linux/timer.h> | 30 | #include <linux/timer.h> |
31 | #include <linux/completion.h> | ||
31 | #include <linux/jiffies.h> | 32 | #include <linux/jiffies.h> |
32 | #include <asm/io.h> | 33 | #include <asm/io.h> |
33 | #include <asm/uaccess.h> | 34 | #include <asm/uaccess.h> |
@@ -57,7 +58,7 @@ static int ticks = 10000; | |||
57 | /* some device data */ | 58 | /* some device data */ |
58 | 59 | ||
59 | static struct { | 60 | static struct { |
60 | struct semaphore stop; | 61 | struct completion stop; |
61 | volatile int running; | 62 | volatile int running; |
62 | struct timer_list timer; | 63 | struct timer_list timer; |
63 | volatile int queue; | 64 | volatile int queue; |
@@ -85,7 +86,7 @@ static void cpu5wdt_trigger(unsigned long unused) | |||
85 | } | 86 | } |
86 | else { | 87 | else { |
87 | /* ticks doesn't matter anyway */ | 88 | /* ticks doesn't matter anyway */ |
88 | up(&cpu5wdt_device.stop); | 89 | complete(&cpu5wdt_device.stop); |
89 | } | 90 | } |
90 | 91 | ||
91 | } | 92 | } |
@@ -239,7 +240,7 @@ static int __devinit cpu5wdt_init(void) | |||
239 | if ( !val ) | 240 | if ( !val ) |
240 | printk(KERN_INFO PFX "sorry, was my fault\n"); | 241 | printk(KERN_INFO PFX "sorry, was my fault\n"); |
241 | 242 | ||
242 | init_MUTEX_LOCKED(&cpu5wdt_device.stop); | 243 | init_completion(&cpu5wdt_device.stop); |
243 | cpu5wdt_device.queue = 0; | 244 | cpu5wdt_device.queue = 0; |
244 | 245 | ||
245 | clear_bit(0, &cpu5wdt_device.inuse); | 246 | clear_bit(0, &cpu5wdt_device.inuse); |
@@ -269,7 +270,7 @@ static void __devexit cpu5wdt_exit(void) | |||
269 | { | 270 | { |
270 | if ( cpu5wdt_device.queue ) { | 271 | if ( cpu5wdt_device.queue ) { |
271 | cpu5wdt_device.queue = 0; | 272 | cpu5wdt_device.queue = 0; |
272 | down(&cpu5wdt_device.stop); | 273 | wait_for_completion(&cpu5wdt_device.stop); |
273 | } | 274 | } |
274 | 275 | ||
275 | misc_deregister(&cpu5wdt_misc); | 276 | misc_deregister(&cpu5wdt_misc); |