aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-ali1535.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-ali1535.c')
-rw-r--r--drivers/i2c/busses/i2c-ali1535.c7
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
137static struct pci_driver ali1535_driver; 138static struct pci_driver ali1535_driver;
138static unsigned short ali1535_smba; 139static unsigned short ali1535_smba;
139static DECLARE_MUTEX(i2c_ali1535_sem); 140static 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 }
462EXIT: 463EXIT:
463 up(&i2c_ali1535_sem); 464 mutex_unlock(&i2c_ali1535_mutex);
464 return result; 465 return result;
465} 466}
466 467