* [PATCH] ps3: vuart: semaphore to mutex
[not found] <20080111041959.337397837@mvista.com>
@ 2008-01-11 4:21 ` Daniel Walker
2008-01-11 8:20 ` Geert Uytterhoeven
0 siblings, 1 reply; 3+ messages in thread
From: Daniel Walker @ 2008-01-11 4:21 UTC (permalink / raw)
To: geoffrey.levand; +Cc: linuxppc-dev, mingo
This probe_mutex conforms to the new struct mutex type.
This patch converts it from the old semaphore to the new struct mutex.
Signed-off-by: Daniel Walker <dwalker@mvista•com>
---
drivers/ps3/ps3-vuart.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
Index: linux-2.6.23/drivers/ps3/ps3-vuart.c
===================================================================
--- linux-2.6.23.orig/drivers/ps3/ps3-vuart.c
+++ linux-2.6.23/drivers/ps3/ps3-vuart.c
@@ -23,6 +23,7 @@
#include <linux/interrupt.h>
#include <linux/workqueue.h>
#include <linux/bitops.h>
+#include <linux/mutex.h>
#include <asm/ps3.h>
#include <asm/firmware.h>
@@ -877,7 +878,7 @@ static int ps3_vuart_handle_port_interru
struct vuart_bus_priv {
struct ports_bmp *bmp;
unsigned int virq;
- struct semaphore probe_mutex;
+ struct mutex probe_mutex;
int use_count;
struct ps3_system_bus_device *devices[PORT_COUNT];
} static vuart_bus_priv;
@@ -1015,7 +1016,7 @@ static int ps3_vuart_probe(struct ps3_sy
return -EINVAL;
}
- down(&vuart_bus_priv.probe_mutex);
+ mutex_lock(&vuart_bus_priv.probe_mutex);
result = ps3_vuart_bus_interrupt_get();
@@ -1075,7 +1076,7 @@ static int ps3_vuart_probe(struct ps3_sy
goto fail_probe;
}
- up(&vuart_bus_priv.probe_mutex);
+ mutex_unlock(&vuart_bus_priv.probe_mutex);
return result;
@@ -1088,7 +1089,7 @@ fail_dev_malloc:
fail_busy:
ps3_vuart_bus_interrupt_put();
fail_setup_interrupt:
- up(&vuart_bus_priv.probe_mutex);
+ mutex_unlock(&vuart_bus_priv.probe_mutex);
dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
return result;
}
@@ -1127,7 +1128,7 @@ static int ps3_vuart_remove(struct ps3_s
BUG_ON(!dev);
- down(&vuart_bus_priv.probe_mutex);
+ mutex_lock(&vuart_bus_priv.probe_mutex);
dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
dev->match_id);
@@ -1135,7 +1136,7 @@ static int ps3_vuart_remove(struct ps3_s
if (!dev->core.driver) {
dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
__LINE__);
- up(&vuart_bus_priv.probe_mutex);
+ mutex_unlock(&vuart_bus_priv.probe_mutex);
return 0;
}
@@ -1158,7 +1159,7 @@ static int ps3_vuart_remove(struct ps3_s
priv = NULL;
dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
- up(&vuart_bus_priv.probe_mutex);
+ mutex_unlock(&vuart_bus_priv.probe_mutex);
return 0;
}
@@ -1178,7 +1179,7 @@ static int ps3_vuart_shutdown(struct ps3
BUG_ON(!dev);
- down(&vuart_bus_priv.probe_mutex);
+ mutex_lock(&vuart_bus_priv.probe_mutex);
dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
dev->match_id);
@@ -1186,7 +1187,7 @@ static int ps3_vuart_shutdown(struct ps3
if (!dev->core.driver) {
dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
__LINE__);
- up(&vuart_bus_priv.probe_mutex);
+ mutex_unlock(&vuart_bus_priv.probe_mutex);
return 0;
}
@@ -1210,7 +1211,7 @@ static int ps3_vuart_shutdown(struct ps3
dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
- up(&vuart_bus_priv.probe_mutex);
+ mutex_unlock(&vuart_bus_priv.probe_mutex);
return 0;
}
@@ -1221,7 +1222,7 @@ static int __init ps3_vuart_bus_init(voi
if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
return -ENODEV;
- init_MUTEX(&vuart_bus_priv.probe_mutex);
+ mutex_init(&vuart_bus_priv.probe_mutex);
return 0;
}
--
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ps3: vuart: semaphore to mutex
2008-01-11 4:21 ` [PATCH] ps3: vuart: semaphore to mutex Daniel Walker
@ 2008-01-11 8:20 ` Geert Uytterhoeven
2008-01-11 9:17 ` Daniel Walker
0 siblings, 1 reply; 3+ messages in thread
From: Geert Uytterhoeven @ 2008-01-11 8:20 UTC (permalink / raw)
To: Daniel Walker; +Cc: linuxppc-dev, mingo
[-- Attachment #1: Type: TEXT/PLAIN, Size: 803 bytes --]
On Thu, 10 Jan 2008, Daniel Walker wrote:
> This probe_mutex conforms to the new struct mutex type.
> This patch converts it from the old semaphore to the new struct mutex.
The PS3 tree already has this change.
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom•com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ps3: vuart: semaphore to mutex
2008-01-11 8:20 ` Geert Uytterhoeven
@ 2008-01-11 9:17 ` Daniel Walker
0 siblings, 0 replies; 3+ messages in thread
From: Daniel Walker @ 2008-01-11 9:17 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linuxppc-dev, mingo
On Fri, 2008-01-11 at 09:20 +0100, Geert Uytterhoeven wrote:
> On Thu, 10 Jan 2008, Daniel Walker wrote:
> > This probe_mutex conforms to the new struct mutex type.
> > This patch converts it from the old semaphore to the new struct mutex.
>
> The PS3 tree already has this change.
>
> With kind regards,
Ok, thanks..
Daniel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2008-01-11 9:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20080111041959.337397837@mvista.com>
2008-01-11 4:21 ` [PATCH] ps3: vuart: semaphore to mutex Daniel Walker
2008-01-11 8:20 ` Geert Uytterhoeven
2008-01-11 9:17 ` Daniel Walker
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox