diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-03-23 03:00:21 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-23 07:38:10 -0800 |
commit | 8ed965d612d9e9bc08805c75123f063cf6966311 (patch) | |
tree | 7a863b9cb0d408295193f888b06d40d3364a404a /drivers/connector | |
parent | 9cdf18279d1f4a2d075ebe924d74e6e4547f6e1b (diff) | |
download | linux-8ed965d612d9e9bc08805c75123f063cf6966311.tar.gz linux-8ed965d612d9e9bc08805c75123f063cf6966311.tar.bz2 linux-8ed965d612d9e9bc08805c75123f063cf6966311.zip |
[PATCH] sem2mutex: drivers: raw, connector, dcdbas, ppp_generic
Semaphore to mutex conversion.
The conversion was generated via scripts, and the result was validated
automatically via a script as well.
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/connector')
-rw-r--r-- | drivers/connector/connector.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/connector/connector.c b/drivers/connector/connector.c index d7125f4d9113..35897079a78d 100644 --- a/drivers/connector/connector.c +++ b/drivers/connector/connector.c @@ -26,6 +26,7 @@ #include <linux/netlink.h> #include <linux/moduleparam.h> #include <linux/connector.h> +#include <linux/mutex.h> #include <net/sock.h> @@ -41,7 +42,7 @@ module_param(cn_val, uint, 0); MODULE_PARM_DESC(cn_idx, "Connector's main device idx."); MODULE_PARM_DESC(cn_val, "Connector's main device val."); -static DECLARE_MUTEX(notify_lock); +static DEFINE_MUTEX(notify_lock); static LIST_HEAD(notify_list); static struct cn_dev cdev; @@ -260,7 +261,7 @@ static void cn_notify(struct cb_id *id, u32 notify_event) { struct cn_ctl_entry *ent; - down(¬ify_lock); + mutex_lock(¬ify_lock); list_for_each_entry(ent, ¬ify_list, notify_entry) { int i; struct cn_notify_req *req; @@ -293,7 +294,7 @@ static void cn_notify(struct cb_id *id, u32 notify_event) cn_netlink_send(&m, ctl->group, GFP_KERNEL); } } - up(¬ify_lock); + mutex_unlock(¬ify_lock); } /* @@ -407,14 +408,14 @@ static void cn_callback(void *data) if (ctl->group == 0) { struct cn_ctl_entry *n; - down(¬ify_lock); + mutex_lock(¬ify_lock); list_for_each_entry_safe(ent, n, ¬ify_list, notify_entry) { if (cn_ctl_msg_equals(ent->msg, ctl)) { list_del(&ent->notify_entry); kfree(ent); } } - up(¬ify_lock); + mutex_unlock(¬ify_lock); return; } @@ -429,9 +430,9 @@ static void cn_callback(void *data) memcpy(ent->msg, ctl, size - sizeof(*ent)); - down(¬ify_lock); + mutex_lock(¬ify_lock); list_add(&ent->notify_entry, ¬ify_list); - up(¬ify_lock); + mutex_unlock(¬ify_lock); } static int __init cn_init(void) |