aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Walker <dwalker@mvista.com>2008-01-10 23:53:21 -0500
committerRalf Baechle <ralf@linux-mips.org>2008-01-29 05:15:01 -0500
commit8a39c520b28f1ffa528baaae6ecfaa3feb5377a5 (patch)
treefedbbff988de9586f4dd750d4c1dcadb2e3fe900
parentf6ed10ab972b00cd57567a2ac9e393226840e458 (diff)
[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: Daniel Walker <dwalker@mvista.com> Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
-rw-r--r--arch/mips/lasat/picvue.c2
-rw-r--r--arch/mips/lasat/picvue.h3
-rw-r--r--arch/mips/lasat/picvue_proc.c18
3 files changed, 10 insertions, 13 deletions
diff --git a/arch/mips/lasat/picvue.c b/arch/mips/lasat/picvue.c
index 6471d0663fd8..d3d04c392e25 100644
--- a/arch/mips/lasat/picvue.c
+++ b/arch/mips/lasat/picvue.c
@@ -22,8 +22,6 @@
22 22
23struct pvc_defs *picvue; 23struct pvc_defs *picvue;
24 24
25DECLARE_MUTEX(pvc_sem);
26
27static void pvc_reg_write(u32 val) 25static void pvc_reg_write(u32 val)
28{ 26{
29 *picvue->reg = val; 27 *picvue->reg = val;
diff --git a/arch/mips/lasat/picvue.h b/arch/mips/lasat/picvue.h
index 2a96bf971897..91df55371127 100644
--- a/arch/mips/lasat/picvue.h
+++ b/arch/mips/lasat/picvue.h
@@ -4,8 +4,6 @@
4 * Brian Murphy <brian.murphy@eicon.com> 4 * Brian Murphy <brian.murphy@eicon.com>
5 * 5 *
6 */ 6 */
7#include <asm/semaphore.h>
8
9struct pvc_defs { 7struct pvc_defs {
10 volatile u32 *reg; 8 volatile u32 *reg;
11 u32 data_shift; 9 u32 data_shift;
@@ -45,4 +43,3 @@ void pvc_move(u8 cmd);
45void pvc_clear(void); 43void pvc_clear(void);
46void pvc_home(void); 44void pvc_home(void);
47 45
48extern struct semaphore pvc_sem;
diff --git a/arch/mips/lasat/picvue_proc.c b/arch/mips/lasat/picvue_proc.c
index 9947c1525822..0bb6037afba3 100644
--- a/arch/mips/lasat/picvue_proc.c
+++ b/arch/mips/lasat/picvue_proc.c
@@ -13,9 +13,11 @@
13#include <linux/interrupt.h> 13#include <linux/interrupt.h>
14 14
15#include <linux/timer.h> 15#include <linux/timer.h>
16#include <linux/mutex.h>
16 17
17#include "picvue.h" 18#include "picvue.h"
18 19
20static DEFINE_MUTEX(pvc_mutex);
19static char pvc_lines[PVC_NLINES][PVC_LINELEN+1]; 21static char pvc_lines[PVC_NLINES][PVC_LINELEN+1];
20static int pvc_linedata[PVC_NLINES]; 22static int pvc_linedata[PVC_NLINES];
21static struct proc_dir_entry *pvc_display_dir; 23static struct proc_dir_entry *pvc_display_dir;
@@ -48,9 +50,9 @@ static int pvc_proc_read_line(char *page, char **start,
48 return 0; 50 return 0;
49 } 51 }
50 52
51 down(&pvc_sem); 53 mutex_lock(&pvc_mutex);
52 page += sprintf(page, "%s\n", pvc_lines[lineno]); 54 page += sprintf(page, "%s\n", pvc_lines[lineno]);
53 up(&pvc_sem); 55 mutex_unlock(&pvc_mutex);
54 56
55 return page - origpage; 57 return page - origpage;
56} 58}
@@ -73,10 +75,10 @@ static int pvc_proc_write_line(struct file *file, const char *buffer,
73 if (buffer[count-1] == '\n') 75 if (buffer[count-1] == '\n')
74 count--; 76 count--;
75 77
76 down(&pvc_sem); 78 mutex_lock(&pvc_mutex);
77 strncpy(pvc_lines[lineno], buffer, count); 79 strncpy(pvc_lines[lineno], buffer, count);
78 pvc_lines[lineno][count] = '\0'; 80 pvc_lines[lineno][count] = '\0';
79 up(&pvc_sem); 81 mutex_unlock(&pvc_mutex);
80 82
81 tasklet_schedule(&pvc_display_tasklet); 83 tasklet_schedule(&pvc_display_tasklet);
82 84
@@ -89,7 +91,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer,
89 int origcount = count; 91 int origcount = count;
90 int cmd = simple_strtol(buffer, NULL, 10); 92 int cmd = simple_strtol(buffer, NULL, 10);
91 93
92 down(&pvc_sem); 94 mutex_lock(&pvc_mutex);
93 if (scroll_interval != 0) 95 if (scroll_interval != 0)
94 del_timer(&timer); 96 del_timer(&timer);
95 97
@@ -106,7 +108,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer,
106 } 108 }
107 add_timer(&timer); 109 add_timer(&timer);
108 } 110 }
109 up(&pvc_sem); 111 mutex_unlock(&pvc_mutex);
110 112
111 return origcount; 113 return origcount;
112} 114}
@@ -117,9 +119,9 @@ static int pvc_proc_read_scroll(char *page, char **start,
117{ 119{
118 char *origpage = page; 120 char *origpage = page;
119 121
120 down(&pvc_sem); 122 mutex_lock(&pvc_mutex);
121 page += sprintf(page, "%d\n", scroll_dir * scroll_interval); 123 page += sprintf(page, "%d\n", scroll_dir * scroll_interval);
122 up(&pvc_sem); 124 mutex_unlock(&pvc_mutex);
123 125
124 return page - origpage; 126 return page - origpage;
125} 127}