Skip to content

Commit

Permalink
sa1100fb: convert ctrlr_sem in a mutex
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Matthias Kaehlcke authored and Linus Torvalds committed Jul 24, 2008
1 parent b91dbce commit 7951ac9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions drivers/video/sa1100fb.c
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
#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>
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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);
}

/*
Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/sa1100fb.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 7951ac9

Please sign in to comment.