[PATCH] pxafb: Convert ctrlr_sem in a mutex

From: Matthias Kaehlcke
Date: Mon May 05 2008 - 16:51:05 EST


pxafb: The semaphore ctrlr_sem is used as a mutex. Convert it to the
mutex API.

Signed-off-by: Matthias Kaehlcke <matthias@xxxxxxxxxxxx>

--

diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c
index 3ab6e3d..a63b77b 100644
--- a/drivers/video/pxafb.c
+++ b/drivers/video/pxafb.c
@@ -40,6 +40,7 @@
#include <linux/clk.h>
#include <linux/err.h>
#include <linux/completion.h>
+#include <linux/mutex.h>
#include <linux/kthread.h>
#include <linux/freezer.h>

@@ -1059,7 +1060,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)
{
u_int old_state;

- down(&fbi->ctrlr_sem);
+ mutex_lock(&fbi->ctrlr_lock);

old_state = fbi->state;

@@ -1147,7 +1148,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state)
}
break;
}
- up(&fbi->ctrlr_sem);
+ mutex_unlock(&fbi->ctrlr_lock);
}

/*
@@ -1399,7 +1400,7 @@ static struct pxafb_info * __init pxafb_init_fbinfo(struct device *dev)

init_waitqueue_head(&fbi->ctrlr_wait);
INIT_WORK(&fbi->task, pxafb_task);
- init_MUTEX(&fbi->ctrlr_sem);
+ mutex_init(&fbi->ctrlr_lock);
init_completion(&fbi->disable_done);
#ifdef CONFIG_FB_PXA_SMARTPANEL
init_completion(&fbi->command_done);
diff --git a/drivers/video/pxafb.h b/drivers/video/pxafb.h
index 8238dc8..31541b8 100644
--- a/drivers/video/pxafb.h
+++ b/drivers/video/pxafb.h
@@ -106,7 +106,7 @@ struct pxafb_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;

--
Matthias Kaehlcke
Embedded Linux Engineer
Barcelona

The assumption that what currently exists must necessarily
exist is the acid that corrodes all visionary thinking
.''`.
using free software / Debian GNU/Linux | http://debian.org : :' :
`. `'`
gpg --keyserver pgp.mit.edu --recv-keys 47D8E5D4 `-
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/