Skip to content

Commit 3fe0c27

Browse files
rostedtIngo Molnar
authored andcommitted
[PATCH] mutex subsystem, semaphore to completion: CPU3WDT
change CPU3WDT semaphores to completions. Signed-off-by: Ingo Molnar <[email protected]>
1 parent 906c3b7 commit 3fe0c27

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

drivers/char/watchdog/cpu5wdt.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
#include <linux/init.h>
2929
#include <linux/ioport.h>
3030
#include <linux/timer.h>
31+
#include <linux/completion.h>
3132
#include <linux/jiffies.h>
3233
#include <asm/io.h>
3334
#include <asm/uaccess.h>
@@ -57,7 +58,7 @@ static int ticks = 10000;
5758
/* some device data */
5859

5960
static struct {
60-
struct semaphore stop;
61+
struct completion stop;
6162
volatile int running;
6263
struct timer_list timer;
6364
volatile int queue;
@@ -85,7 +86,7 @@ static void cpu5wdt_trigger(unsigned long unused)
8586
}
8687
else {
8788
/* ticks doesn't matter anyway */
88-
up(&cpu5wdt_device.stop);
89+
complete(&cpu5wdt_device.stop);
8990
}
9091

9192
}
@@ -239,7 +240,7 @@ static int __devinit cpu5wdt_init(void)
239240
if ( !val )
240241
printk(KERN_INFO PFX "sorry, was my fault\n");
241242

242-
init_MUTEX_LOCKED(&cpu5wdt_device.stop);
243+
init_completion(&cpu5wdt_device.stop);
243244
cpu5wdt_device.queue = 0;
244245

245246
clear_bit(0, &cpu5wdt_device.inuse);
@@ -269,7 +270,7 @@ static void __devexit cpu5wdt_exit(void)
269270
{
270271
if ( cpu5wdt_device.queue ) {
271272
cpu5wdt_device.queue = 0;
272-
down(&cpu5wdt_device.stop);
273+
wait_for_completion(&cpu5wdt_device.stop);
273274
}
274275

275276
misc_deregister(&cpu5wdt_misc);

0 commit comments

Comments
 (0)