Commit c09b1001 authored by Mark M. Hoffman's avatar Mark M. Hoffman Committed by Tom Rini

[PATCH] I2C: i2c nforce2.c fixes

This patch restores a line that was wrongly removed.  There are also some
trivial cleanups.  It applies & compiles vs. 2.6.0-test3.  It's untested
(no hardware here).
parent 3bc44aea
...@@ -51,10 +51,6 @@ MODULE_DESCRIPTION("nForce2 SMBus driver"); ...@@ -51,10 +51,6 @@ MODULE_DESCRIPTION("nForce2 SMBus driver");
#ifndef PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS #ifndef PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS
#define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064
#endif #endif
/* TODO: sync with lm-sensors */
#ifndef I2C_HW_SMBUS_NFORCE2
#define I2C_HW_SMBUS_NFORCE2 0x0c
#endif
struct nforce2_smbus { struct nforce2_smbus {
...@@ -128,20 +124,10 @@ static struct i2c_adapter nforce2_adapter = { ...@@ -128,20 +124,10 @@ static struct i2c_adapter nforce2_adapter = {
.name = "unset", .name = "unset",
}; };
#if 0
/* Internally used pause function */
static 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 */ /* Return -1 on error. See smbus.h for more information */
static s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short flags, static s32 nforce2_access(struct i2c_adapter * adap, u16 addr,
char read_write, u8 command, int size, unsigned short flags, char read_write,
union i2c_smbus_data * data) u8 command, int size, union i2c_smbus_data * data)
{ {
struct nforce2_smbus *smbus = adap->algo_data; struct nforce2_smbus *smbus = adap->algo_data;
unsigned char protocol, pec, temp; unsigned char protocol, pec, temp;
...@@ -249,7 +235,7 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short fl ...@@ -249,7 +235,7 @@ static s32 nforce2_access(struct i2c_adapter * adap, u16 addr, unsigned short fl
#if 0 #if 0
do { do {
nforce2_do_pause(1); i2c_do_pause(1);
temp = inb_p(NVIDIA_SMB_STS); temp = inb_p(NVIDIA_SMB_STS);
} while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT)); } while (((temp & NVIDIA_SMB_STS_DONE) == 0) && (timeout++ < MAX_TIMEOUT));
#endif #endif
...@@ -332,13 +318,8 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg, ...@@ -332,13 +318,8 @@ static int __devinit nforce2_probe_smb (struct pci_dev *dev, int reg,
smbus->base, smbus->base+smbus->size-1, name); smbus->base, smbus->base+smbus->size-1, name);
return -1; return -1;
} }
/*
smbus->adapter.owner = THIS_MODULE;
smbus->adapter.id = I2C_ALGO_SMBUS | I2C_HW_SMBUS_NFORCE2;
smbus->adapter.algo = &smbus_algorithm;
smbus->adapter.algo_data = smbus;
*/
smbus->adapter = nforce2_adapter; smbus->adapter = nforce2_adapter;
smbus->adapter.algo_data = smbus;
smbus->adapter.dev.parent = &dev->dev; smbus->adapter.dev.parent = &dev->dev;
snprintf(smbus->adapter.name, DEVICE_NAME_SIZE, snprintf(smbus->adapter.name, DEVICE_NAME_SIZE,
"SMBus nForce2 adapter at %04x", smbus->base); "SMBus nForce2 adapter at %04x", smbus->base);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment