sa1100fb: convert ctrlr_sem in a mutex
authorMatthias Kaehlcke <matthias@kaehlcke.net>
Thu, 24 Jul 2008 04:31:16 +0000 (21:31 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 24 Jul 2008 17:47:37 +0000 (10:47 -0700)
The semaphore ctrlr_sem is used as a mutex.  Convert it to the mutex API

Signed-off-by: Matthias Kaehlcke <matthias@kaehlcke.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
drivers/video/sa1100fb.c
drivers/video/sa1100fb.h

index 4a9f7e121807e391bdea2d496059d12001b1f076..78bcdbc3f4841bf5ce1c3bdebb25964d650fbc18 100644 (file)
 #include <linux/cpufreq.h>
 #include <linux/platform_device.h>
 #include <linux/dma-mapping.h>
+#include <linux/mutex.h>
 
 #include <asm/hardware.h>
 #include <asm/io.h>
@@ -1108,7 +1109,7 @@ static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state)
 {
        u_int old_state;
 
-       down(&fbi->ctrlr_sem);
+       mutex_lock(&fbi->ctrlr_lock);
 
        old_state = fbi->state;
 
@@ -1193,7 +1194,7 @@ static void set_ctrlr_state(struct sa1100fb_info *fbi, u_int state)
                }
                break;
        }
-       up(&fbi->ctrlr_sem);
+       mutex_unlock(&fbi->ctrlr_lock);
 }
 
 /*
@@ -1445,7 +1446,7 @@ static struct sa1100fb_info * __init sa1100fb_init_fbinfo(struct device *dev)
 
        init_waitqueue_head(&fbi->ctrlr_wait);
        INIT_WORK(&fbi->task, sa1100fb_task);
-       init_MUTEX(&fbi->ctrlr_sem);
+       mutex_init(&fbi->ctrlr_lock);
 
        return fbi;
 }
index f465b27ed860e610b353a14d5c2953ab1d1aec21..86831db9a042d880886d9bc022ac5d6232087159 100644 (file)
@@ -100,7 +100,7 @@ struct sa1100fb_info {
 
        volatile u_char         state;
        volatile u_char         task_state;
-       struct semaphore        ctrlr_sem;
+       struct mutex            ctrlr_lock;
        wait_queue_head_t       ctrlr_wait;
        struct work_struct      task;