i2c: Consistently reject unsupported transactions

Many PC SMBus host controller drivers don't properly handle the case
where they are requested to achieve a transaction they do not support.
Update them so that the consistently print a warning message and
return a single error value in this case.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
Jean Delvare
2008-07-14 22:38:25 +02:00
committed by Jean Delvare
parent fa63cd56d2
commit ac7fc4fb2b
10 changed files with 23 additions and 34 deletions

View File

@@ -307,9 +307,6 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr,
int status;
switch (size) {
case I2C_SMBUS_PROC_CALL:
dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n");
return -EOPNOTSUPP;
case I2C_SMBUS_QUICK:
outb_p((addr << 1) | read_write,
SMBHSTADD);
@@ -355,6 +352,9 @@ static s32 piix4_access(struct i2c_adapter * adap, u16 addr,
}
size = PIIX4_BLOCK_DATA;
break;
default:
dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
return -EOPNOTSUPP;
}
outb_p((size & 0x1C) + (ENABLE_INT9 & 1), SMBHSTCNT);