aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2006-01-18 17:17:01 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2006-03-23 17:21:51 -0500
commit3fb9a65529615944138d527b70174840c95c637a (patch)
tree86833e442c87dfbcda7ee5644120ee8a9a9d0f8c
parent5c085d369c2c4f18942ec8951466e186366d5c78 (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>
-rw-r--r--drivers/i2c/busses/i2c-ali1535.c1
-rw-r--r--drivers/i2c/busses/i2c-pxa.c2
-rw-r--r--drivers/i2c/busses/scx200_acb.c9
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c
index 26cf891762b8..115a7312948e 100644
--- a/drivers/i2c/busses/i2c-ali1535.c
+++ b/drivers/i2c/busses/i2c-ali1535.c
@@ -64,7 +64,6 @@
64#include <linux/init.h> 64#include <linux/init.h>
65#include <linux/mutex.h> 65#include <linux/mutex.h>
66#include <asm/io.h> 66#include <asm/io.h>
67#include <asm/semaphore.h>
68 67
69 68
70/* ALI1535 SMBus address offsets */ 69/* ALI1535 SMBus address offsets */
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c
index 7579f4b256a8..5155010b455e 100644
--- a/drivers/i2c/busses/i2c-pxa.c
+++ b/drivers/i2c/busses/i2c-pxa.c
@@ -647,7 +647,7 @@ static inline void i2c_pxa_start_message(struct pxa_i2c *i2c)
647} 647}
648 648
649/* 649/*
650 * We are protected by the adapter bus semaphore. 650 * We are protected by the adapter bus mutex.
651 */ 651 */
652static int i2c_pxa_do_xfer(struct pxa_i2c *i2c, struct i2c_msg *msg, int num) 652static int i2c_pxa_do_xfer(struct pxa_i2c *i2c, struct i2c_msg *msg, int num)
653{ 653{
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);