diff options
author | Jean Delvare <khali@linux-fr.org> | 2006-01-18 17:17:01 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:21:51 -0500 |
commit | 3fb9a65529615944138d527b70174840c95c637a (patch) | |
tree | 86833e442c87dfbcda7ee5644120ee8a9a9d0f8c /drivers/i2c/busses/scx200_acb.c | |
parent | 5c085d369c2c4f18942ec8951466e186366d5c78 (diff) |
[PATCH] i2c: Semaphore to mutex conversions, part 3
Cleanup after the semaphores to mutexes conversions in the i2c
subsystem.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses/scx200_acb.c')
-rw-r--r-- | drivers/i2c/busses/scx200_acb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 8e646bdb556c..8bd305e47f0d 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -31,6 +31,7 @@ | |||
31 | #include <linux/smp_lock.h> | 31 | #include <linux/smp_lock.h> |
32 | #include <linux/pci.h> | 32 | #include <linux/pci.h> |
33 | #include <linux/delay.h> | 33 | #include <linux/delay.h> |
34 | #include <linux/mutex.h> | ||
34 | #include <asm/io.h> | 35 | #include <asm/io.h> |
35 | #include <asm/msr.h> | 36 | #include <asm/msr.h> |
36 | 37 | ||
@@ -74,7 +75,7 @@ struct scx200_acb_iface { | |||
74 | struct scx200_acb_iface *next; | 75 | struct scx200_acb_iface *next; |
75 | struct i2c_adapter adapter; | 76 | struct i2c_adapter adapter; |
76 | unsigned base; | 77 | unsigned base; |
77 | struct semaphore sem; | 78 | struct mutex mutex; |
78 | 79 | ||
79 | /* State machine data */ | 80 | /* State machine data */ |
80 | enum scx200_acb_state state; | 81 | enum scx200_acb_state state; |
@@ -314,7 +315,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter, | |||
314 | return -EINVAL; | 315 | return -EINVAL; |
315 | } | 316 | } |
316 | 317 | ||
317 | down(&iface->sem); | 318 | mutex_lock(&iface->mutex); |
318 | 319 | ||
319 | iface->address_byte = (address << 1) | rw; | 320 | iface->address_byte = (address << 1) | rw; |
320 | iface->command = command; | 321 | iface->command = command; |
@@ -338,7 +339,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter, | |||
338 | 339 | ||
339 | rc = iface->result; | 340 | rc = iface->result; |
340 | 341 | ||
341 | up(&iface->sem); | 342 | mutex_unlock(&iface->mutex); |
342 | 343 | ||
343 | if (rc == 0 && size == I2C_SMBUS_WORD_DATA && rw == I2C_SMBUS_READ) | 344 | if (rc == 0 && size == I2C_SMBUS_WORD_DATA && rw == I2C_SMBUS_READ) |
344 | data->word = le16_to_cpu(cur_word); | 345 | data->word = le16_to_cpu(cur_word); |
@@ -431,7 +432,7 @@ static int __init scx200_acb_create(const char *text, int base, int index) | |||
431 | adapter->algo = &scx200_acb_algorithm; | 432 | adapter->algo = &scx200_acb_algorithm; |
432 | adapter->class = I2C_CLASS_HWMON; | 433 | adapter->class = I2C_CLASS_HWMON; |
433 | 434 | ||
434 | init_MUTEX(&iface->sem); | 435 | mutex_init(&iface->mutex); |
435 | 436 | ||
436 | snprintf(description, sizeof(description), "%s ACCESS.bus [%s]", | 437 | snprintf(description, sizeof(description), "%s ACCESS.bus [%s]", |
437 | text, adapter->name); | 438 | text, adapter->name); |