Commit 8a39c520 authored by Daniel Walker's avatar Daniel Walker Committed by Ralf Baechle

[MIPS] Lasat: Convert pvc_sem semaphore to mutex

I also changed the name to pvc_mutex, and moved the define to the file
it's used in which allows it to be static.
Signed-off-by: default avatarDaniel Walker <dwalker@mvista.com>
Signed-off-by: default avatarRalf Baechle <ralf@linux-mips.org>
parent f6ed10ab
...@@ -22,8 +22,6 @@ ...@@ -22,8 +22,6 @@
struct pvc_defs *picvue; struct pvc_defs *picvue;
DECLARE_MUTEX(pvc_sem);
static void pvc_reg_write(u32 val) static void pvc_reg_write(u32 val)
{ {
*picvue->reg = val; *picvue->reg = val;
......
...@@ -4,8 +4,6 @@ ...@@ -4,8 +4,6 @@
* Brian Murphy <brian.murphy@eicon.com> * Brian Murphy <brian.murphy@eicon.com>
* *
*/ */
#include <asm/semaphore.h>
struct pvc_defs { struct pvc_defs {
volatile u32 *reg; volatile u32 *reg;
u32 data_shift; u32 data_shift;
...@@ -45,4 +43,3 @@ void pvc_move(u8 cmd); ...@@ -45,4 +43,3 @@ void pvc_move(u8 cmd);
void pvc_clear(void); void pvc_clear(void);
void pvc_home(void); void pvc_home(void);
extern struct semaphore pvc_sem;
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/timer.h> #include <linux/timer.h>
#include <linux/mutex.h>
#include "picvue.h" #include "picvue.h"
static DEFINE_MUTEX(pvc_mutex);
static char pvc_lines[PVC_NLINES][PVC_LINELEN+1]; static char pvc_lines[PVC_NLINES][PVC_LINELEN+1];
static int pvc_linedata[PVC_NLINES]; static int pvc_linedata[PVC_NLINES];
static struct proc_dir_entry *pvc_display_dir; static struct proc_dir_entry *pvc_display_dir;
...@@ -48,9 +50,9 @@ static int pvc_proc_read_line(char *page, char **start, ...@@ -48,9 +50,9 @@ static int pvc_proc_read_line(char *page, char **start,
return 0; return 0;
} }
down(&pvc_sem); mutex_lock(&pvc_mutex);
page += sprintf(page, "%s\n", pvc_lines[lineno]); page += sprintf(page, "%s\n", pvc_lines[lineno]);
up(&pvc_sem); mutex_unlock(&pvc_mutex);
return page - origpage; return page - origpage;
} }
...@@ -73,10 +75,10 @@ static int pvc_proc_write_line(struct file *file, const char *buffer, ...@@ -73,10 +75,10 @@ static int pvc_proc_write_line(struct file *file, const char *buffer,
if (buffer[count-1] == '\n') if (buffer[count-1] == '\n')
count--; count--;
down(&pvc_sem); mutex_lock(&pvc_mutex);
strncpy(pvc_lines[lineno], buffer, count); strncpy(pvc_lines[lineno], buffer, count);
pvc_lines[lineno][count] = '\0'; pvc_lines[lineno][count] = '\0';
up(&pvc_sem); mutex_unlock(&pvc_mutex);
tasklet_schedule(&pvc_display_tasklet); tasklet_schedule(&pvc_display_tasklet);
...@@ -89,7 +91,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer, ...@@ -89,7 +91,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer,
int origcount = count; int origcount = count;
int cmd = simple_strtol(buffer, NULL, 10); int cmd = simple_strtol(buffer, NULL, 10);
down(&pvc_sem); mutex_lock(&pvc_mutex);
if (scroll_interval != 0) if (scroll_interval != 0)
del_timer(&timer); del_timer(&timer);
...@@ -106,7 +108,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer, ...@@ -106,7 +108,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer,
} }
add_timer(&timer); add_timer(&timer);
} }
up(&pvc_sem); mutex_unlock(&pvc_mutex);
return origcount; return origcount;
} }
...@@ -117,9 +119,9 @@ static int pvc_proc_read_scroll(char *page, char **start, ...@@ -117,9 +119,9 @@ static int pvc_proc_read_scroll(char *page, char **start,
{ {
char *origpage = page; char *origpage = page;
down(&pvc_sem); mutex_lock(&pvc_mutex);
page += sprintf(page, "%d\n", scroll_dir * scroll_interval); page += sprintf(page, "%d\n", scroll_dir * scroll_interval);
up(&pvc_sem); mutex_unlock(&pvc_mutex);
return page - origpage; return page - origpage;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment