aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/device.c
diff options
context:
space:
mode:
authorMatthias Kaehlcke <matthias.kaehlcke@gmail.com>2007-07-16 02:39:49 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-07-16 12:05:41 -0400
commit9ac162521cd9796f44d263a61090634844c719a6 (patch)
tree5988aba4299002ea4a425f747a275d29cb9dd3c5 /drivers/message/i2o/device.c
parent1c6b4aa94576eee6dec3b8011f60d7f666db90b0 (diff)
Use mutexes instead of semaphores in I2O driver
The I2O driver uses two semaphores as mutexes. Use the mutex API instead of the (binary) semaphores. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/message/i2o/device.c')
-rw-r--r--drivers/message/i2o/device.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c
index 611adc3c0f74..489d7c5c4965 100644
--- a/drivers/message/i2o/device.c
+++ b/drivers/message/i2o/device.c
@@ -62,7 +62,7 @@ int i2o_device_claim(struct i2o_device *dev)
62{ 62{
63 int rc = 0; 63 int rc = 0;
64 64
65 down(&dev->lock); 65 mutex_lock(&dev->lock);
66 66
67 rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY); 67 rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY);
68 if (!rc) 68 if (!rc)
@@ -72,7 +72,7 @@ int i2o_device_claim(struct i2o_device *dev)
72 pr_debug("i2o: claim of device %d failed %d\n", 72 pr_debug("i2o: claim of device %d failed %d\n",
73 dev->lct_data.tid, rc); 73 dev->lct_data.tid, rc);
74 74
75 up(&dev->lock); 75 mutex_unlock(&dev->lock);
76 76
77 return rc; 77 return rc;
78} 78}
@@ -96,7 +96,7 @@ int i2o_device_claim_release(struct i2o_device *dev)
96 int tries; 96 int tries;
97 int rc = 0; 97 int rc = 0;
98 98
99 down(&dev->lock); 99 mutex_lock(&dev->lock);
100 100
101 /* 101 /*
102 * If the controller takes a nonblocking approach to 102 * If the controller takes a nonblocking approach to
@@ -118,7 +118,7 @@ int i2o_device_claim_release(struct i2o_device *dev)
118 pr_debug("i2o: claim release of device %d failed %d\n", 118 pr_debug("i2o: claim release of device %d failed %d\n",
119 dev->lct_data.tid, rc); 119 dev->lct_data.tid, rc);
120 120
121 up(&dev->lock); 121 mutex_unlock(&dev->lock);
122 122
123 return rc; 123 return rc;
124} 124}
@@ -198,7 +198,7 @@ static struct i2o_device *i2o_device_alloc(void)
198 return ERR_PTR(-ENOMEM); 198 return ERR_PTR(-ENOMEM);
199 199
200 INIT_LIST_HEAD(&dev->list); 200 INIT_LIST_HEAD(&dev->list);
201 init_MUTEX(&dev->lock); 201 mutex_init(&dev->lock);
202 202
203 dev->device.bus = &i2o_bus_type; 203 dev->device.bus = &i2o_bus_type;
204 dev->device.release = &i2o_device_release; 204 dev->device.release = &i2o_device_release;
@@ -326,7 +326,7 @@ int i2o_device_parse_lct(struct i2o_controller *c)
326 u16 table_size; 326 u16 table_size;
327 u32 buf; 327 u32 buf;
328 328
329 down(&c->lct_lock); 329 mutex_lock(&c->lct_lock);
330 330
331 kfree(c->lct); 331 kfree(c->lct);
332 332
@@ -335,7 +335,7 @@ int i2o_device_parse_lct(struct i2o_controller *c)
335 335
336 lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL); 336 lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL);
337 if (!lct) { 337 if (!lct) {
338 up(&c->lct_lock); 338 mutex_unlock(&c->lct_lock);
339 return -ENOMEM; 339 return -ENOMEM;
340 } 340 }
341 341
@@ -408,7 +408,7 @@ int i2o_device_parse_lct(struct i2o_controller *c)
408 i2o_device_remove(dev); 408 i2o_device_remove(dev);
409 } 409 }
410 410
411 up(&c->lct_lock); 411 mutex_unlock(&c->lct_lock);
412 412
413 return 0; 413 return 0;
414} 414}