From b91dbce56a8dbf312f6255d5121b295553d2b4db Mon Sep 17 00:00:00 2001 From: Matthias Kaehlcke Date: Wed, 23 Jul 2008 21:31:14 -0700 Subject: [PATCH] pxafb: convert ctrlr_sem in a mutex The semaphore ctrlr_sem is used as a mutex. Convert it to the mutex API. Signed-off-by: Matthias Kaehlcke Cc: Daniel Mack Cc: Eric Miao Cc: Russell King Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/pxafb.c | 7 ++++--- drivers/video/pxafb.h | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 5e8a140399f..2b707a8ce5d 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include @@ -1117,7 +1118,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; @@ -1205,7 +1206,7 @@ static void set_ctrlr_state(struct pxafb_info *fbi, u_int state) } break; } - up(&fbi->ctrlr_sem); + mutex_unlock(&fbi->ctrlr_lock); } /* @@ -1458,7 +1459,7 @@ static struct pxafb_info * __devinit 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 8238dc82642..31541b86f13 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; -- 2.41.1