Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH] mips: picvue: pvc_sem semaphore to mutex
  2008-01-11  4:53 [PATCH] mips: picvue: pvc_sem semaphore to mutex Daniel Walker
@ 2008-01-11  4:53 ` Daniel Walker
  2008-01-11 17:22   ` Brian Murphy
  2008-01-11 12:32 ` Ralf Baechle
  2008-01-11 12:32 ` Ralf Baechle
  2 siblings, 1 reply; 6+ messages in thread
From: Daniel Walker @ 2008-01-11  4:53 UTC (permalink / raw)
  To: brian; +Cc: mingo, ralf, linux-mips

This semaphore conforms to the new struct mutex, so I've converted it
to use that new API.

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>

---
 arch/mips/lasat/picvue.c      |    2 --
 arch/mips/lasat/picvue.h      |    3 ---
 arch/mips/lasat/picvue_proc.c |   18 ++++++++++--------
 3 files changed, 10 insertions(+), 13 deletions(-)

Index: linux-2.6.23/arch/mips/lasat/picvue.c
===================================================================
--- linux-2.6.23.orig/arch/mips/lasat/picvue.c
+++ linux-2.6.23/arch/mips/lasat/picvue.c
@@ -22,8 +22,6 @@
 
 struct pvc_defs *picvue;
 
-DECLARE_MUTEX(pvc_sem);
-
 static void pvc_reg_write(u32 val)
 {
 	*picvue->reg = val;
Index: linux-2.6.23/arch/mips/lasat/picvue.h
===================================================================
--- linux-2.6.23.orig/arch/mips/lasat/picvue.h
+++ linux-2.6.23/arch/mips/lasat/picvue.h
@@ -4,8 +4,6 @@
  * Brian Murphy <brian.murphy@eicon.com>
  *
  */
-#include <asm/semaphore.h>
-
 struct pvc_defs {
 	volatile u32 *reg;
 	u32 data_shift;
@@ -45,4 +43,3 @@ void pvc_move(u8 cmd);
 void pvc_clear(void);
 void pvc_home(void);
 
-extern struct semaphore pvc_sem;
Index: linux-2.6.23/arch/mips/lasat/picvue_proc.c
===================================================================
--- linux-2.6.23.orig/arch/mips/lasat/picvue_proc.c
+++ linux-2.6.23/arch/mips/lasat/picvue_proc.c
@@ -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;
@@ -48,9 +50,9 @@ static int pvc_proc_read_line(char *page
 		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;
 }
@@ -73,10 +75,10 @@ static int pvc_proc_write_line(struct fi
 	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);
 
@@ -89,7 +91,7 @@ static int pvc_proc_write_scroll(struct 
 	int origcount = count;
 	int cmd = simple_strtol(buffer, NULL, 10);
 
-	down(&pvc_sem);
+	mutex_lock(&pvc_mutex);
 	if (scroll_interval != 0)
 		del_timer(&timer);
 
@@ -106,7 +108,7 @@ static int pvc_proc_write_scroll(struct 
 		}
 		add_timer(&timer);
 	}
-	up(&pvc_sem);
+	mutex_unlock(&pvc_mutex);
 
 	return origcount;
 }
@@ -117,9 +119,9 @@ static int pvc_proc_read_scroll(char *pa
 {
 	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;
 }
-- 

-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH] mips: picvue: pvc_sem semaphore to mutex
  2008-01-11  4:53 ` Daniel Walker
@ 2008-01-11  4:53 Daniel Walker
  2008-01-11  4:53 ` Daniel Walker
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Daniel Walker @ 2008-01-11  4:53 UTC (permalink / raw)
  To: brian; +Cc: mingo, ralf, linux-mips

This semaphore conforms to the new struct mutex, so I've converted it
to use that new API.

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>

---
 arch/mips/lasat/picvue.c      |    2 --
 arch/mips/lasat/picvue.h      |    3 ---
 arch/mips/lasat/picvue_proc.c |   18 ++++++++++--------
 3 files changed, 10 insertions(+), 13 deletions(-)

Index: linux-2.6.23/arch/mips/lasat/picvue.c
===================================================================
--- linux-2.6.23.orig/arch/mips/lasat/picvue.c
+++ linux-2.6.23/arch/mips/lasat/picvue.c
@@ -22,8 +22,6 @@
 
 struct pvc_defs *picvue;
 
-DECLARE_MUTEX(pvc_sem);
-
 static void pvc_reg_write(u32 val)
 {
 	*picvue->reg = val;
Index: linux-2.6.23/arch/mips/lasat/picvue.h
===================================================================
--- linux-2.6.23.orig/arch/mips/lasat/picvue.h
+++ linux-2.6.23/arch/mips/lasat/picvue.h
@@ -4,8 +4,6 @@
  * Brian Murphy <brian.murphy@eicon.com>
  *
  */
-#include <asm/semaphore.h>
-
 struct pvc_defs {
 	volatile u32 *reg;
 	u32 data_shift;
@@ -45,4 +43,3 @@ void pvc_move(u8 cmd);
 void pvc_clear(void);
 void pvc_home(void);
 
-extern struct semaphore pvc_sem;
Index: linux-2.6.23/arch/mips/lasat/picvue_proc.c
===================================================================
--- linux-2.6.23.orig/arch/mips/lasat/picvue_proc.c
+++ linux-2.6.23/arch/mips/lasat/picvue_proc.c
@@ -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;
@@ -48,9 +50,9 @@ static int pvc_proc_read_line(char *page
 		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;
 }
@@ -73,10 +75,10 @@ static int pvc_proc_write_line(struct fi
 	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);
 
@@ -89,7 +91,7 @@ static int pvc_proc_write_scroll(struct 
 	int origcount = count;
 	int cmd = simple_strtol(buffer, NULL, 10);
 
-	down(&pvc_sem);
+	mutex_lock(&pvc_mutex);
 	if (scroll_interval != 0)
 		del_timer(&timer);
 
@@ -106,7 +108,7 @@ static int pvc_proc_write_scroll(struct 
 		}
 		add_timer(&timer);
 	}
-	up(&pvc_sem);
+	mutex_unlock(&pvc_mutex);
 
 	return origcount;
 }
@@ -117,9 +119,9 @@ static int pvc_proc_read_scroll(char *pa
 {
 	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;
 }
-- 

-- 

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mips: picvue: pvc_sem semaphore to mutex
  2008-01-11  4:53 [PATCH] mips: picvue: pvc_sem semaphore to mutex Daniel Walker
  2008-01-11  4:53 ` Daniel Walker
@ 2008-01-11 12:32 ` Ralf Baechle
  2008-01-11 12:32 ` Ralf Baechle
  2 siblings, 0 replies; 6+ messages in thread
From: Ralf Baechle @ 2008-01-11 12:32 UTC (permalink / raw)
  To: Daniel Walker; +Cc: brian, mingo, linux-mips

On Thu, Jan 10, 2008 at 08:53:21PM -0800, Daniel Walker wrote:

> This semaphore conforms to the new struct mutex, so I've converted it
> to use that new API.
> 
> 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.

Queued for 2.6.25, thanks.

  Ralf

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mips: picvue: pvc_sem semaphore to mutex
  2008-01-11  4:53 [PATCH] mips: picvue: pvc_sem semaphore to mutex Daniel Walker
  2008-01-11  4:53 ` Daniel Walker
  2008-01-11 12:32 ` Ralf Baechle
@ 2008-01-11 12:32 ` Ralf Baechle
  2008-01-11 15:41   ` Daniel Walker
  2 siblings, 1 reply; 6+ messages in thread
From: Ralf Baechle @ 2008-01-11 12:32 UTC (permalink / raw)
  To: Daniel Walker; +Cc: brian, mingo, linux-mips

On Thu, Jan 10, 2008 at 08:53:21PM -0800, Daniel Walker wrote:
> From: Daniel Walker <dwalker@mvista.com>
> Date: Thu, 10 Jan 2008 20:53:48 -0800
> Date: Thu, 10 Jan 2008 20:53:21 -0800

Btw, your email headers are looking slightly odd ;-)

  Ralf

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mips: picvue: pvc_sem semaphore to mutex
  2008-01-11 12:32 ` Ralf Baechle
@ 2008-01-11 15:41   ` Daniel Walker
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Walker @ 2008-01-11 15:41 UTC (permalink / raw)
  To: Ralf Baechle; +Cc: brian, mingo, linux-mips


On Fri, 2008-01-11 at 12:32 +0000, Ralf Baechle wrote:
> On Thu, Jan 10, 2008 at 08:53:21PM -0800, Daniel Walker wrote:
> > From: Daniel Walker <dwalker@mvista.com>
> > Date: Thu, 10 Jan 2008 20:53:48 -0800
> > Date: Thu, 10 Jan 2008 20:53:21 -0800
> 
> Btw, your email headers are looking slightly odd ;-)

Hmm .. Not sure how that happened .. Must be something in my quilt tho,
thanks for noticing it.

Daniel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] mips: picvue: pvc_sem semaphore to mutex
  2008-01-11  4:53 ` Daniel Walker
@ 2008-01-11 17:22   ` Brian Murphy
  0 siblings, 0 replies; 6+ messages in thread
From: Brian Murphy @ 2008-01-11 17:22 UTC (permalink / raw)
  To: Daniel Walker; +Cc: mingo, ralf, linux-mips

Daniel Walker wrote:
> This semaphore conforms to the new struct mutex, so I've converted it
> to use that new API.
>
> 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>
>
>   
Thanks.

/Brian

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2008-01-11 17:22 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-01-11  4:53 [PATCH] mips: picvue: pvc_sem semaphore to mutex Daniel Walker
2008-01-11  4:53 ` Daniel Walker
2008-01-11 17:22   ` Brian Murphy
2008-01-11 12:32 ` Ralf Baechle
2008-01-11 12:32 ` Ralf Baechle
2008-01-11 15:41   ` Daniel Walker

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox