Added utility function i2c_delay(1), to replace various "do_pause"

(mmh) functions in bus drivers.  Backported from the 2.6 work of Greg KH.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/trunk@1936 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Mark M. Hoffman committed 2003-08-03 05:11:58 +00:00
1 parent e49b5486aa
commit e035136982
11 files changed
+18 -101

No files matched your search

+2 -9
View File
@@ -223,13 +223,6 @@ static int ali15x3_setup(struct pci_dev *ALI15X3_dev)
return 0;
}
/* Internally used pause function */
static void ali15x3_do_pause(unsigned int amount)
{
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(amount);
}
/* Another internally used function */
static int ali15x3_transaction(struct i2c_adapter *adap)
{
@@ -302,7 +295,7 @@ static int ali15x3_transaction(struct i2c_adapter *adap)
/* We will always wait for a fraction of a second! */
timeout = 0;
do {
ali15x3_do_pause(1);
i2c_delay(1);
temp = inb_p(SMBHSTSTS);
} while ((!(temp & (ALI15X3_STS_ERR | ALI15X3_STS_DONE)))
&& (timeout++ < MAX_TIMEOUT));
@@ -359,7 +352,7 @@ static s32 ali15x3_access(struct i2c_adapter * adap, u16 addr,
for (timeout = 0;
(timeout < MAX_TIMEOUT) && !(temp & ALI15X3_STS_IDLE);
timeout++) {
ali15x3_do_pause(1);
i2c_delay(1);
temp = inb_p(SMBHSTSTS);
}
if (timeout >= MAX_TIMEOUT) {