diff options
author | Evgeniy Polyakov <johnpol@2ka.mipt.ru> | 2006-04-03 04:04:27 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-22 14:22:50 -0400 |
commit | abd52a13206e02537ca1dc08fc5438c7d27bdbf1 (patch) | |
tree | efe0ff89898aad10600d392ac727dcea9e7af322 /drivers/w1/w1_int.c | |
parent | 46e07f6e5eb0e465e086b8f485f4238bd453e3e9 (diff) |
[PATCH] w1: Use mutexes instead of semaphores.
Use mutexes instead of semaphores.
Patch tested on x86_64 and i386 with test bus master driver.
Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/w1/w1_int.c')
-rw-r--r-- | drivers/w1/w1_int.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/w1/w1_int.c b/drivers/w1/w1_int.c index ae78473d11f9..24e7c102fa75 100644 --- a/drivers/w1/w1_int.c +++ b/drivers/w1/w1_int.c | |||
@@ -36,7 +36,7 @@ extern struct device w1_master_device; | |||
36 | extern int w1_max_slave_count; | 36 | extern int w1_max_slave_count; |
37 | extern int w1_max_slave_ttl; | 37 | extern int w1_max_slave_ttl; |
38 | extern struct list_head w1_masters; | 38 | extern struct list_head w1_masters; |
39 | extern struct semaphore w1_mlock; | 39 | extern struct mutex w1_mlock; |
40 | 40 | ||
41 | extern int w1_process(void *); | 41 | extern int w1_process(void *); |
42 | 42 | ||
@@ -74,7 +74,7 @@ static struct w1_master * w1_alloc_dev(u32 id, int slave_count, int slave_ttl, | |||
74 | atomic_set(&dev->refcnt, 2); | 74 | atomic_set(&dev->refcnt, 2); |
75 | 75 | ||
76 | INIT_LIST_HEAD(&dev->slist); | 76 | INIT_LIST_HEAD(&dev->slist); |
77 | init_MUTEX(&dev->mutex); | 77 | mutex_init(&dev->mutex); |
78 | 78 | ||
79 | memcpy(&dev->dev, device, sizeof(struct device)); | 79 | memcpy(&dev->dev, device, sizeof(struct device)); |
80 | snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), | 80 | snprintf(dev->dev.bus_id, sizeof(dev->dev.bus_id), |
@@ -135,9 +135,9 @@ int w1_add_master_device(struct w1_bus_master *master) | |||
135 | 135 | ||
136 | dev->initialized = 1; | 136 | dev->initialized = 1; |
137 | 137 | ||
138 | down(&w1_mlock); | 138 | mutex_lock(&w1_mlock); |
139 | list_add(&dev->w1_master_entry, &w1_masters); | 139 | list_add(&dev->w1_master_entry, &w1_masters); |
140 | up(&w1_mlock); | 140 | mutex_unlock(&w1_mlock); |
141 | 141 | ||
142 | memset(&msg, 0, sizeof(msg)); | 142 | memset(&msg, 0, sizeof(msg)); |
143 | msg.id.mst.id = dev->id; | 143 | msg.id.mst.id = dev->id; |