diff --git a/kernel/busses/i2c-ali1535.c b/kernel/busses/i2c-ali1535.c index 602cc553..936ca7f7 100644 --- a/kernel/busses/i2c-ali1535.c +++ b/kernel/busses/i2c-ali1535.c @@ -136,7 +136,6 @@ /* -> Read = 1 */ #define ALI1535_SMBIO_EN 0x04 /* SMB I/O Space enable */ -static void ali1535_do_pause(unsigned int amount); static int ali1535_transaction(void); static unsigned short ali1535_smba = 0; @@ -222,13 +221,6 @@ int ali1535_setup(struct pci_dev *ALI1535_dev) } -/* Internally used pause function */ -void ali1535_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - /* Another internally used function */ int ali1535_transaction(void) { @@ -315,7 +307,7 @@ int ali1535_transaction(void) /* We will always wait for a fraction of a second! */ timeout = 0; do { - ali1535_do_pause(1); + i2c_delay(1); temp = inb_p(SMBHSTSTS); } while (((temp & ALI1535_STS_BUSY) && !(temp & ALI1535_STS_IDLE)) && (timeout++ < MAX_TIMEOUT)); @@ -401,7 +393,7 @@ s32 ali1535_access(struct i2c_adapter * adap, u16 addr, for (timeout = 0; (timeout < MAX_TIMEOUT) && !(temp & ALI1535_STS_IDLE); timeout++) { - ali1535_do_pause(1); + i2c_delay(1); temp = inb_p(SMBHSTSTS); } if (timeout >= MAX_TIMEOUT) { diff --git a/kernel/busses/i2c-ali15x3.c b/kernel/busses/i2c-ali15x3.c index 8ba2ddaa..8b440a5d 100644 --- a/kernel/busses/i2c-ali15x3.c +++ b/kernel/busses/i2c-ali15x3.c @@ -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) { diff --git a/kernel/busses/i2c-amd756.c b/kernel/busses/i2c-amd756.c index eaedfcdb..c2130596 100644 --- a/kernel/busses/i2c-amd756.c +++ b/kernel/busses/i2c-amd756.c @@ -94,13 +94,6 @@ static unsigned short amd756_ioport = 0; */ -/* Internally used pause function */ -static void amd756_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - #define GS_ABRT_STS (1 << 0) #define GS_COL_STS (1 << 1) #define GS_PRERR_STS (1 << 2) @@ -132,7 +125,7 @@ static int amd756_transaction(void) if ((temp = inw_p(SMB_GLOBAL_STATUS)) & (GS_HST_STS | GS_SMB_STS)) { pr_debug(DRV_NAME ": SMBus busy (%04x). Waiting... \n", temp); do { - amd756_do_pause(1); + i2c_delay(1); temp = inw_p(SMB_GLOBAL_STATUS); } while ((temp & (GS_HST_STS | GS_SMB_STS)) && (timeout++ < MAX_TIMEOUT)); @@ -149,7 +142,7 @@ static int amd756_transaction(void) /* We will always wait for a fraction of a second! */ do { - amd756_do_pause(1); + i2c_delay(1); temp = inw_p(SMB_GLOBAL_STATUS); } while ((temp & GS_HST_STS) && (timeout++ < MAX_TIMEOUT)); @@ -196,7 +189,7 @@ static int amd756_transaction(void) abort: printk(KERN_WARNING DRV_NAME ": Sending abort.\n"); outw_p(inw(SMB_GLOBAL_ENABLE) | GE_ABORT, SMB_GLOBAL_ENABLE); - amd756_do_pause(100); + i2c_delay(100); outw_p(GS_CLEAR_STS, SMB_GLOBAL_STATUS); return -1; } diff --git a/kernel/busses/i2c-amd8111.c b/kernel/busses/i2c-amd8111.c index 38578437..b5b3c98b 100644 --- a/kernel/busses/i2c-amd8111.c +++ b/kernel/busses/i2c-amd8111.c @@ -281,8 +281,7 @@ s32 amd8111_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, } if (~temp[0] & AMD_SMB_STS_DONE) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/100); + i2c_delay(HZ/100); amd_ec_read(smbus, AMD_SMB_STS, temp + 0); } diff --git a/kernel/busses/i2c-i801.c b/kernel/busses/i2c-i801.c index 04c7df31..ebe0f620 100644 --- a/kernel/busses/i2c-i801.c +++ b/kernel/busses/i2c-i801.c @@ -110,7 +110,6 @@ MODULE_PARM_DESC(force_addr, "Forcibly enable the I801 at the given address. " "EXTREMELY DANGEROUS!"); -static void i801_do_pause(unsigned int amount); static int i801_transaction(void); static int i801_block_transaction(union i2c_smbus_data *data, char read_write, int command); @@ -186,12 +185,6 @@ END: } -static void i801_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - static int i801_transaction(void) { int temp; @@ -221,7 +214,7 @@ static int i801_transaction(void) /* We will always wait for a fraction of a second! */ do { - i801_do_pause(1); + i2c_delay(1); temp = inb_p(SMBHSTSTS); } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT)); @@ -349,7 +342,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write, timeout = 0; do { temp = inb_p(SMBHSTSTS); - i801_do_pause(1); + i2c_delay(1); } while ((!(temp & 0x80)) && (timeout++ < MAX_TIMEOUT)); @@ -409,7 +402,7 @@ static int i801_block_transaction(union i2c_smbus_data *data, char read_write, timeout = 0; do { temp = inb_p(SMBHSTSTS); - i801_do_pause(1); + i2c_delay(1); } while ((!(temp & 0x02)) && (timeout++ < MAX_TIMEOUT)); diff --git a/kernel/busses/i2c-nforce2.c b/kernel/busses/i2c-nforce2.c index c4d0cf94..4f4e64d2 100644 --- a/kernel/busses/i2c-nforce2.c +++ b/kernel/busses/i2c-nforce2.c @@ -112,9 +112,6 @@ struct nforce2_smbus { static s32 nforce2_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, union i2c_smbus_data *data); -#if 0 -static void nforce2_do_pause(unsigned int amount); -#endif /* static int nforce2_block_transaction(union i2c_smbus_data *data, char read_write, int i2c_enable); @@ -129,17 +126,6 @@ static struct i2c_algorithm smbus_algorithm = { .functionality = nforce2_func, }; - - -#if 0 -/* Internally used pause function */ -void nforce2_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} -#endif - /* Return -1 on error. See smbus.h for more information */ s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, char read_write, u8 command, int size, @@ -250,7 +236,7 @@ s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, #if 0 do { - nforce2_do_pause(1); + i2c_delay(1); temp = inb_p(NVIDIA_SMB_STS); } while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT)); #endif @@ -259,8 +245,7 @@ s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, temp = inb_p(NVIDIA_SMB_STS); } if (~temp & NVIDIA_SMB_STS_DONE) { - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(HZ/100); + i2c_delay(HZ/100); temp = inb_p(NVIDIA_SMB_STS); } diff --git a/kernel/busses/i2c-piix4.c b/kernel/busses/i2c-piix4.c index aa3159ab..e06acf82 100644 --- a/kernel/busses/i2c-piix4.c +++ b/kernel/busses/i2c-piix4.c @@ -100,7 +100,6 @@ MODULE_PARM_DESC(force_addr, "Forcibly enable the PIIX4 at the given address. " "EXTREMELY DANGEROUS!"); -static void piix4_do_pause(unsigned int amount); static int piix4_transaction(void); @@ -235,13 +234,6 @@ static int piix4_setup(struct pci_dev *PIIX4_dev, const struct pci_device_id *id } -/* Internally used pause function */ -void piix4_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - /* Another internally used function */ int piix4_transaction(void) { @@ -280,7 +272,7 @@ int piix4_transaction(void) /* We will always wait for a fraction of a second! (See PIIX4 docs errata) */ do { - piix4_do_pause(1); + i2c_delay(1); temp = inb_p(SMBHSTSTS); } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT)); diff --git a/kernel/busses/i2c-sis5595.c b/kernel/busses/i2c-sis5595.c index 233d1377..d12b82cb 100644 --- a/kernel/busses/i2c-sis5595.c +++ b/kernel/busses/i2c-sis5595.c @@ -131,7 +131,6 @@ MODULE_PARM(force_addr, "i"); MODULE_PARM_DESC(force_addr, "Initialize the base address of the i2c controller"); -static void sis5595_do_pause(unsigned int amount); static int sis5595_transaction(void); static unsigned short sis5595_base = 0; @@ -228,13 +227,6 @@ int sis5595_setup(struct pci_dev *SIS5595_dev) } -/* Internally used pause function */ -void sis5595_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - /* Another internally used function */ int sis5595_transaction(void) { @@ -273,7 +265,7 @@ int sis5595_transaction(void) /* We will always wait for a fraction of a second! */ do { - sis5595_do_pause(1); + i2c_delay(1); temp = sis5595_read(SMB_STS_LO); } while (!(temp & 0x40) && (timeout++ < MAX_TIMEOUT)); diff --git a/kernel/busses/i2c-sis630.c b/kernel/busses/i2c-sis630.c index c185e5df..568b9e92 100644 --- a/kernel/busses/i2c-sis630.c +++ b/kernel/busses/i2c-sis630.c @@ -127,14 +127,6 @@ static inline void sis630_write(u8 reg, u8 data) { outb(data, acpi_base + reg); } -/* Internally used pause function */ -static void sis630_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - - static int sis630_transaction_start(int size, u8 *oldclock) { int temp; @@ -180,7 +172,7 @@ static int sis630_transaction_wait(int size) { /* We will always wait for a fraction of a second! */ do { - sis630_do_pause(1); + i2c_delay(1); temp = sis630_read(SMB_STS); /* check if block transmitted */ if (size == SIS630_BLOCK_DATA && (temp & 0x10)) diff --git a/kernel/busses/i2c-sis645.c b/kernel/busses/i2c-sis645.c index b84b689e..16725a6e 100644 --- a/kernel/busses/i2c-sis645.c +++ b/kernel/busses/i2c-sis645.c @@ -294,13 +294,6 @@ static int __devinit sis645_hotplug_smbus(void) } #endif /* CONFIG_HOTPLUG */ -/* Internally used pause function */ -static void sis645_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - /* Execute a SMBus transaction. int size is from SIS645_QUICK to SIS645_BLOCK_DATA */ @@ -345,7 +338,7 @@ static int sis645_transaction(int size) /* We will always wait for a fraction of a second! */ do { - sis645_do_pause(1); + i2c_delay(1); temp = sis645_read(SMB_STS); } while (!(temp & 0x0e) && (timeout++ < MAX_TIMEOUT)); diff --git a/kernel/busses/i2c-viapro.c b/kernel/busses/i2c-viapro.c index 21f2c3ab..d999859b 100644 --- a/kernel/busses/i2c-viapro.c +++ b/kernel/busses/i2c-viapro.c @@ -105,13 +105,6 @@ MODULE_PARM_DESC(force_addr, static struct i2c_adapter vt596_adapter; -/* Internally used pause function */ -static void vt596_do_pause(unsigned int amount) -{ - current->state = TASK_INTERRUPTIBLE; - schedule_timeout(amount); -} - /* Another internally used function */ static int vt596_transaction(void) { @@ -145,7 +138,7 @@ static int vt596_transaction(void) /* We will always wait for a fraction of a second! I don't know if VIA needs this, Intel did */ do { - vt596_do_pause(1); + i2c_delay(1); temp = inb_p(SMBHSTSTS); } while ((temp & 0x01) && (timeout++ < MAX_TIMEOUT));