diff options
author | Arjan van de Ven <arjan@infradead.org> | 2006-01-11 04:50:26 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-03-23 17:21:49 -0500 |
commit | b3585e4f5b3e4ddb4d82ae50d0b844f619c6d821 (patch) | |
tree | 5375363cc6087d74196efc0ded6dae9a8a4c2ad5 /drivers/i2c/busses/i2c-ali1535.c | |
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/i2c-ali1535.c')
-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 3eb47890db40..26cf891762b8 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c | |||
@@ -62,6 +62,7 @@ | |||
62 | #include <linux/ioport.h> | 62 | #include <linux/ioport.h> |
63 | #include <linux/i2c.h> | 63 | #include <linux/i2c.h> |
64 | #include <linux/init.h> | 64 | #include <linux/init.h> |
65 | #include <linux/mutex.h> | ||
65 | #include <asm/io.h> | 66 | #include <asm/io.h> |
66 | #include <asm/semaphore.h> | 67 | #include <asm/semaphore.h> |
67 | 68 | ||
@@ -136,7 +137,7 @@ | |||
136 | 137 | ||
137 | static struct pci_driver ali1535_driver; | 138 | static struct pci_driver ali1535_driver; |
138 | static unsigned short ali1535_smba; | 139 | static unsigned short ali1535_smba; |
139 | static DECLARE_MUTEX(i2c_ali1535_sem); | 140 | static DEFINE_MUTEX(i2c_ali1535_mutex); |
140 | 141 | ||
141 | /* Detect whether a ALI1535 can be found, and initialize it, where necessary. | 142 | /* Detect whether a ALI1535 can be found, and initialize it, where necessary. |
142 | Note the differences between kernels with the old PCI BIOS interface and | 143 | 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, | |||
345 | int timeout; | 346 | int timeout; |
346 | s32 result = 0; | 347 | s32 result = 0; |
347 | 348 | ||
348 | down(&i2c_ali1535_sem); | 349 | mutex_lock(&i2c_ali1535_mutex); |
349 | /* make sure SMBus is idle */ | 350 | /* make sure SMBus is idle */ |
350 | temp = inb_p(SMBHSTSTS); | 351 | temp = inb_p(SMBHSTSTS); |
351 | for (timeout = 0; | 352 | for (timeout = 0; |
@@ -460,7 +461,7 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr, | |||
460 | break; | 461 | break; |
461 | } | 462 | } |
462 | EXIT: | 463 | EXIT: |
463 | up(&i2c_ali1535_sem); | 464 | mutex_unlock(&i2c_ali1535_mutex); |
464 | return result; | 465 | return result; |
465 | } | 466 | } |
466 | 467 | ||