Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 78055
b: refs/heads/master
c: 8a39c52
h: refs/heads/master
i:
  78053: 3566ccf
  78051: 88ddb69
  78047: c42d67d
v: v3
  • Loading branch information
Daniel Walker authored and Ralf Baechle committed Jan 29, 2008
1 parent 184e299 commit 29c21b2
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f6ed10ab972b00cd57567a2ac9e393226840e458
refs/heads/master: 8a39c520b28f1ffa528baaae6ecfaa3feb5377a5
2 changes: 0 additions & 2 deletions trunk/arch/mips/lasat/picvue.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@

struct pvc_defs *picvue;

DECLARE_MUTEX(pvc_sem);

static void pvc_reg_write(u32 val)
{
*picvue->reg = val;
Expand Down
3 changes: 0 additions & 3 deletions trunk/arch/mips/lasat/picvue.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
* Brian Murphy <brian.murphy@eicon.com>
*
*/
#include <asm/semaphore.h>

struct pvc_defs {
volatile u32 *reg;
u32 data_shift;
Expand Down Expand Up @@ -45,4 +43,3 @@ void pvc_move(u8 cmd);
void pvc_clear(void);
void pvc_home(void);

extern struct semaphore pvc_sem;
18 changes: 10 additions & 8 deletions trunk/arch/mips/lasat/picvue_proc.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@
#include <linux/interrupt.h>

#include <linux/timer.h>
#include <linux/mutex.h>

#include "picvue.h"

static DEFINE_MUTEX(pvc_mutex);
static char pvc_lines[PVC_NLINES][PVC_LINELEN+1];
static int pvc_linedata[PVC_NLINES];
static struct proc_dir_entry *pvc_display_dir;
Expand Down Expand Up @@ -48,9 +50,9 @@ static int pvc_proc_read_line(char *page, char **start,
return 0;
}

down(&pvc_sem);
mutex_lock(&pvc_mutex);
page += sprintf(page, "%s\n", pvc_lines[lineno]);
up(&pvc_sem);
mutex_unlock(&pvc_mutex);

return page - origpage;
}
Expand All @@ -73,10 +75,10 @@ static int pvc_proc_write_line(struct file *file, const char *buffer,
if (buffer[count-1] == '\n')
count--;

down(&pvc_sem);
mutex_lock(&pvc_mutex);
strncpy(pvc_lines[lineno], buffer, count);
pvc_lines[lineno][count] = '\0';
up(&pvc_sem);
mutex_unlock(&pvc_mutex);

tasklet_schedule(&pvc_display_tasklet);

Expand All @@ -89,7 +91,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer,
int origcount = count;
int cmd = simple_strtol(buffer, NULL, 10);

down(&pvc_sem);
mutex_lock(&pvc_mutex);
if (scroll_interval != 0)
del_timer(&timer);

Expand All @@ -106,7 +108,7 @@ static int pvc_proc_write_scroll(struct file *file, const char *buffer,
}
add_timer(&timer);
}
up(&pvc_sem);
mutex_unlock(&pvc_mutex);

return origcount;
}
Expand All @@ -117,9 +119,9 @@ static int pvc_proc_read_scroll(char *page, char **start,
{
char *origpage = page;

down(&pvc_sem);
mutex_lock(&pvc_mutex);
page += sprintf(page, "%d\n", scroll_dir * scroll_interval);
up(&pvc_sem);
mutex_unlock(&pvc_mutex);

return page - origpage;
}
Expand Down

0 comments on commit 29c21b2

Please sign in to comment.