diff options
author | Jean Delvare <khali@linux-fr.org> | 2006-01-18 23:17:01 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 14:21:51 -0800 |
commit | 3fb9a65529615944138d527b70174840c95c637a (patch) | |
tree | 86833e442c87dfbcda7ee5644120ee8a9a9d0f8c /drivers/i2c/busses/scx200_acb.c | |
parent | 5c085d369c2c4f18942ec8951466e186366d5c78 (diff) | |
download | talos-op-linux-3fb9a65529615944138d527b70174840c95c637a.tar.gz talos-op-linux-3fb9a65529615944138d527b70174840c95c637a.zip |
[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 @@ #include <linux/smp_lock.h> #include <linux/pci.h> #include <linux/delay.h> +#include <linux/mutex.h> #include <asm/io.h> #include <asm/msr.h> @@ -74,7 +75,7 @@ struct scx200_acb_iface { struct scx200_acb_iface *next; struct i2c_adapter adapter; unsigned base; - struct semaphore sem; + struct mutex mutex; /* State machine data */ enum scx200_acb_state state; @@ -314,7 +315,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter, return -EINVAL; } - down(&iface->sem); + mutex_lock(&iface->mutex); iface->address_byte = (address << 1) | rw; iface->command = command; @@ -338,7 +339,7 @@ static s32 scx200_acb_smbus_xfer(struct i2c_adapter *adapter, rc = iface->result; - up(&iface->sem); + mutex_unlock(&iface->mutex); if (rc == 0 && size == I2C_SMBUS_WORD_DATA && rw == I2C_SMBUS_READ) data->word = le16_to_cpu(cur_word); @@ -431,7 +432,7 @@ static int __init scx200_acb_create(const char *text, int base, int index) adapter->algo = &scx200_acb_algorithm; adapter->class = I2C_CLASS_HWMON; - init_MUTEX(&iface->sem); + mutex_init(&iface->mutex); snprintf(description, sizeof(description), "%s ACCESS.bus [%s]", text, adapter->name); |