Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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>

authored by

Daniel Walker and committed by
Ralf Baechle
8a39c520 f6ed10ab

+10 -13
-2
arch/mips/lasat/picvue.c
··· 22 22 23 23 struct pvc_defs *picvue; 24 24 25 - DECLARE_MUTEX(pvc_sem); 26 - 27 25 static void pvc_reg_write(u32 val) 28 26 { 29 27 *picvue->reg = val;
-3
arch/mips/lasat/picvue.h
··· 4 4 * Brian Murphy <brian.murphy@eicon.com> 5 5 * 6 6 */ 7 - #include <asm/semaphore.h> 8 - 9 7 struct pvc_defs { 10 8 volatile u32 *reg; 11 9 u32 data_shift; ··· 43 45 void pvc_clear(void); 44 46 void pvc_home(void); 45 47 46 - extern struct semaphore pvc_sem;
+10 -8
arch/mips/lasat/picvue_proc.c
··· 13 13 #include <linux/interrupt.h> 14 14 15 15 #include <linux/timer.h> 16 + #include <linux/mutex.h> 16 17 17 18 #include "picvue.h" 18 19 20 + static DEFINE_MUTEX(pvc_mutex); 19 21 static char pvc_lines[PVC_NLINES][PVC_LINELEN+1]; 20 22 static int pvc_linedata[PVC_NLINES]; 21 23 static struct proc_dir_entry *pvc_display_dir; ··· 50 48 return 0; 51 49 } 52 50 53 - down(&pvc_sem); 51 + mutex_lock(&pvc_mutex); 54 52 page += sprintf(page, "%s\n", pvc_lines[lineno]); 55 - up(&pvc_sem); 53 + mutex_unlock(&pvc_mutex); 56 54 57 55 return page - origpage; 58 56 } ··· 75 73 if (buffer[count-1] == '\n') 76 74 count--; 77 75 78 - down(&pvc_sem); 76 + mutex_lock(&pvc_mutex); 79 77 strncpy(pvc_lines[lineno], buffer, count); 80 78 pvc_lines[lineno][count] = '\0'; 81 - up(&pvc_sem); 79 + mutex_unlock(&pvc_mutex); 82 80 83 81 tasklet_schedule(&pvc_display_tasklet); 84 82 ··· 91 89 int origcount = count; 92 90 int cmd = simple_strtol(buffer, NULL, 10); 93 91 94 - down(&pvc_sem); 92 + mutex_lock(&pvc_mutex); 95 93 if (scroll_interval != 0) 96 94 del_timer(&timer); 97 95 ··· 108 106 } 109 107 add_timer(&timer); 110 108 } 111 - up(&pvc_sem); 109 + mutex_unlock(&pvc_mutex); 112 110 113 111 return origcount; 114 112 } ··· 119 117 { 120 118 char *origpage = page; 121 119 122 - down(&pvc_sem); 120 + mutex_lock(&pvc_mutex); 123 121 page += sprintf(page, "%d\n", scroll_dir * scroll_interval); 124 - up(&pvc_sem); 122 + mutex_unlock(&pvc_mutex); 125 123 126 124 return page - origpage; 127 125 }