Commit 2b73809d authored by Jean Delvare's avatar Jean Delvare Committed by Jean Delvare

i2c-i801: Rename local variable temp to status

"temp" isn't a terribly well chosen name for a local variable.
Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
parent dcb5c923
...@@ -134,18 +134,18 @@ static unsigned int i801_features; ...@@ -134,18 +134,18 @@ static unsigned int i801_features;
static int i801_transaction(int xact) static int i801_transaction(int xact)
{ {
int temp; int status;
int result = 0; int result = 0;
int timeout = 0; int timeout = 0;
/* Make sure the SMBus host is ready to start transmitting */ /* Make sure the SMBus host is ready to start transmitting */
/* 0x1f = Failed, Bus_Err, Dev_Err, Intr, Host_Busy */ /* 0x1f = Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) { if ((status = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
dev_dbg(&I801_dev->dev, "SMBus busy (%02x). Resetting...\n", dev_dbg(&I801_dev->dev, "SMBus busy (%02x). Resetting...\n",
temp); status);
outb_p(temp, SMBHSTSTS); outb_p(status, SMBHSTSTS);
if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) { if ((status = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
dev_dbg(&I801_dev->dev, "Failed! (%02x)\n", temp); dev_dbg(&I801_dev->dev, "Failed! (%02x)\n", status);
return -EBUSY; return -EBUSY;
} else { } else {
dev_dbg(&I801_dev->dev, "Successful!\n"); dev_dbg(&I801_dev->dev, "Successful!\n");
...@@ -159,8 +159,8 @@ static int i801_transaction(int xact) ...@@ -159,8 +159,8 @@ static int i801_transaction(int xact)
/* We will always wait for a fraction of a second! */ /* We will always wait for a fraction of a second! */
do { do {
msleep(1); msleep(1);
temp = inb_p(SMBHSTSTS); status = inb_p(SMBHSTSTS);
} while ((temp & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT)); } while ((status & SMBHSTSTS_HOST_BUSY) && (timeout++ < MAX_TIMEOUT));
/* If the SMBus is still busy, we give up */ /* If the SMBus is still busy, we give up */
if (timeout >= MAX_TIMEOUT) { if (timeout >= MAX_TIMEOUT) {
...@@ -173,17 +173,17 @@ static int i801_transaction(int xact) ...@@ -173,17 +173,17 @@ static int i801_transaction(int xact)
outb_p(inb_p(SMBHSTCNT) & (~SMBHSTCNT_KILL), SMBHSTCNT); outb_p(inb_p(SMBHSTCNT) & (~SMBHSTCNT_KILL), SMBHSTCNT);
} }
if (temp & SMBHSTSTS_FAILED) { if (status & SMBHSTSTS_FAILED) {
result = -EIO; result = -EIO;
dev_dbg(&I801_dev->dev, "Error: Failed bus transaction\n"); dev_dbg(&I801_dev->dev, "Error: Failed bus transaction\n");
} }
if (temp & SMBHSTSTS_BUS_ERR) { if (status & SMBHSTSTS_BUS_ERR) {
result = -EAGAIN; result = -EAGAIN;
dev_dbg(&I801_dev->dev, "Lost arbitration\n"); dev_dbg(&I801_dev->dev, "Lost arbitration\n");
} }
if (temp & SMBHSTSTS_DEV_ERR) { if (status & SMBHSTSTS_DEV_ERR) {
result = -ENXIO; result = -ENXIO;
dev_dbg(&I801_dev->dev, "Error: no response!\n"); dev_dbg(&I801_dev->dev, "Error: no response!\n");
} }
...@@ -191,9 +191,9 @@ static int i801_transaction(int xact) ...@@ -191,9 +191,9 @@ static int i801_transaction(int xact)
if ((inb_p(SMBHSTSTS) & 0x1f) != 0x00) if ((inb_p(SMBHSTSTS) & 0x1f) != 0x00)
outb_p(inb(SMBHSTSTS), SMBHSTSTS); outb_p(inb(SMBHSTSTS), SMBHSTSTS);
if ((temp = (0x1f & inb_p(SMBHSTSTS))) != 0x00) { if ((status = (0x1f & inb_p(SMBHSTSTS))) != 0x00) {
dev_dbg(&I801_dev->dev, "Failed reset at end of transaction " dev_dbg(&I801_dev->dev, "Failed reset at end of transaction "
"(%02x)\n", temp); "(%02x)\n", status);
} }
return result; return result;
} }
...@@ -202,18 +202,18 @@ static int i801_transaction(int xact) ...@@ -202,18 +202,18 @@ static int i801_transaction(int xact)
static void i801_wait_hwpec(void) static void i801_wait_hwpec(void)
{ {
int timeout = 0; int timeout = 0;
int temp; int status;
do { do {
msleep(1); msleep(1);
temp = inb_p(SMBHSTSTS); status = inb_p(SMBHSTSTS);
} while ((!(temp & SMBHSTSTS_INTR)) } while ((!(status & SMBHSTSTS_INTR))
&& (timeout++ < MAX_TIMEOUT)); && (timeout++ < MAX_TIMEOUT));
if (timeout >= MAX_TIMEOUT) { if (timeout >= MAX_TIMEOUT) {
dev_dbg(&I801_dev->dev, "PEC Timeout!\n"); dev_dbg(&I801_dev->dev, "PEC Timeout!\n");
} }
outb_p(temp, SMBHSTSTS); outb_p(status, SMBHSTSTS);
} }
static int i801_block_transaction_by_block(union i2c_smbus_data *data, static int i801_block_transaction_by_block(union i2c_smbus_data *data,
...@@ -255,7 +255,7 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, ...@@ -255,7 +255,7 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
{ {
int i, len; int i, len;
int smbcmd; int smbcmd;
int temp; int status;
int result = 0; int result = 0;
int timeout; int timeout;
unsigned char errmask; unsigned char errmask;
...@@ -283,7 +283,7 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, ...@@ -283,7 +283,7 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
outb_p(smbcmd | ENABLE_INT9, SMBHSTCNT); outb_p(smbcmd | ENABLE_INT9, SMBHSTCNT);
/* Make sure the SMBus host is ready to start transmitting */ /* Make sure the SMBus host is ready to start transmitting */
temp = inb_p(SMBHSTSTS); status = inb_p(SMBHSTSTS);
if (i == 1) { if (i == 1) {
/* Erroneous conditions before transaction: /* Erroneous conditions before transaction:
* Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */ * Byte_Done, Failed, Bus_Err, Dev_Err, Intr, Host_Busy */
...@@ -293,13 +293,13 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, ...@@ -293,13 +293,13 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
* Failed, Bus_Err, Dev_Err, Intr */ * Failed, Bus_Err, Dev_Err, Intr */
errmask = 0x1e; errmask = 0x1e;
} }
if (temp & errmask) { if (status & errmask) {
dev_dbg(&I801_dev->dev, "SMBus busy (%02x). " dev_dbg(&I801_dev->dev, "SMBus busy (%02x). "
"Resetting...\n", temp); "Resetting...\n", status);
outb_p(temp, SMBHSTSTS); outb_p(status, SMBHSTSTS);
if (((temp = inb_p(SMBHSTSTS)) & errmask) != 0x00) { if (((status = inb_p(SMBHSTSTS)) & errmask) != 0x00) {
dev_err(&I801_dev->dev, dev_err(&I801_dev->dev,
"Reset failed! (%02x)\n", temp); "Reset failed! (%02x)\n", status);
return -EBUSY; return -EBUSY;
} }
if (i != 1) if (i != 1)
...@@ -314,9 +314,9 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, ...@@ -314,9 +314,9 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
timeout = 0; timeout = 0;
do { do {
msleep(1); msleep(1);
temp = inb_p(SMBHSTSTS); status = inb_p(SMBHSTSTS);
} }
while ((!(temp & SMBHSTSTS_BYTE_DONE)) while ((!(status & SMBHSTSTS_BYTE_DONE))
&& (timeout++ < MAX_TIMEOUT)); && (timeout++ < MAX_TIMEOUT));
/* If the SMBus is still busy, we give up */ /* If the SMBus is still busy, we give up */
...@@ -332,14 +332,14 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, ...@@ -332,14 +332,14 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
dev_dbg(&I801_dev->dev, "SMBus Timeout!\n"); dev_dbg(&I801_dev->dev, "SMBus Timeout!\n");
} }
if (temp & SMBHSTSTS_FAILED) { if (status & SMBHSTSTS_FAILED) {
result = -EIO; result = -EIO;
dev_dbg(&I801_dev->dev, dev_dbg(&I801_dev->dev,
"Error: Failed bus transaction\n"); "Error: Failed bus transaction\n");
} else if (temp & SMBHSTSTS_BUS_ERR) { } else if (status & SMBHSTSTS_BUS_ERR) {
result = -EAGAIN; result = -EAGAIN;
dev_dbg(&I801_dev->dev, "Lost arbitration\n"); dev_dbg(&I801_dev->dev, "Lost arbitration\n");
} else if (temp & SMBHSTSTS_DEV_ERR) { } else if (status & SMBHSTSTS_DEV_ERR) {
result = -ENXIO; result = -ENXIO;
dev_dbg(&I801_dev->dev, "Error: no response!\n"); dev_dbg(&I801_dev->dev, "Error: no response!\n");
} }
...@@ -357,13 +357,13 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data, ...@@ -357,13 +357,13 @@ static int i801_block_transaction_byte_by_byte(union i2c_smbus_data *data,
data->block[i] = inb_p(SMBBLKDAT); data->block[i] = inb_p(SMBBLKDAT);
if (read_write == I2C_SMBUS_WRITE && i+1 <= len) if (read_write == I2C_SMBUS_WRITE && i+1 <= len)
outb_p(data->block[i+1], SMBBLKDAT); outb_p(data->block[i+1], SMBBLKDAT);
if ((temp & 0x9e) != 0x00) if ((status & 0x9e) != 0x00)
outb_p(temp, SMBHSTSTS); /* signals SMBBLKDAT ready */ outb_p(status, SMBHSTSTS); /* signals SMBBLKDAT ready */
if ((temp = (0x1e & inb_p(SMBHSTSTS))) != 0x00) { if ((status = (0x1e & inb_p(SMBHSTSTS))) != 0x00) {
dev_dbg(&I801_dev->dev, dev_dbg(&I801_dev->dev,
"Bad status (%02x) at end of transaction\n", "Bad status (%02x) at end of transaction\n",
temp); status);
} }
if (result < 0) if (result < 0)
......
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