diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-11 10:50:26 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 14:21:49 -0800 |
commit | b3585e4f5b3e4ddb4d82ae50d0b844f619c6d821 (patch) | |
tree | 5375363cc6087d74196efc0ded6dae9a8a4c2ad5 /drivers/i2c/busses | |
parent | 2488a39d233a758d41ab7de70a220bc956f3c96c (diff) |
[PATCH] I2C: Convert i2c to mutexes
The patch below converts a few i2c semaphores to mutexes
Signed-off-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r-- | drivers/i2c/busses/i2c-ali1535.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index 3eb47890db4..26cf891762b 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c @@ -62,6 +62,7 @@ #include <linux/ioport.h> #include <linux/i2c.h> #include <linux/init.h> +#include <linux/mutex.h> #include <asm/io.h> #include <asm/semaphore.h> @@ -136,7 +137,7 @@ static struct pci_driver ali1535_driver; static unsigned short ali1535_smba; -static DECLARE_MUTEX(i2c_ali1535_sem); +static DEFINE_MUTEX(i2c_ali1535_mutex); /* Detect whether a ALI1535 can be found, and initialize it, where necessary. Note the differences between kernels with the old PCI BIOS interface and @@ -345,7 +346,7 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr, int timeout; s32 result = 0; - down(&i2c_ali1535_sem); + mutex_lock(&i2c_ali1535_mutex); /* make sure SMBus is idle */ temp = inb_p(SMBHSTSTS); for (timeout = 0; @@ -460,7 +461,7 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr, break; } EXIT: - up(&i2c_ali1535_sem); + mutex_unlock(&i2c_ali1535_mutex); return result; } |