diff options
author | Jean Delvare <khali@linux-fr.org> | 2008-07-14 16:38:25 -0400 |
---|---|---|
committer | Jean Delvare <khali@mahadeva.delvare> | 2008-07-14 16:38:25 -0400 |
commit | ac7fc4fb2b6a126af8d07f46500440c9641976cf (patch) | |
tree | 1ba7a6b229699f6d69cfe3f1bd74c020e952e16b /drivers/i2c/busses/i2c-ali1535.c | |
parent | fa63cd56d2f09806169307d761e8f430e23bc09b (diff) |
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>
Diffstat (limited to 'drivers/i2c/busses/i2c-ali1535.c')
-rw-r--r-- | drivers/i2c/busses/i2c-ali1535.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-ali1535.c b/drivers/i2c/busses/i2c-ali1535.c index c21e4d96382e..704436cdec8e 100644 --- a/drivers/i2c/busses/i2c-ali1535.c +++ b/drivers/i2c/busses/i2c-ali1535.c | |||
@@ -357,10 +357,6 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr, | |||
357 | outb_p(0xFF, SMBHSTSTS); | 357 | outb_p(0xFF, SMBHSTSTS); |
358 | 358 | ||
359 | switch (size) { | 359 | switch (size) { |
360 | case I2C_SMBUS_PROC_CALL: | ||
361 | dev_err(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n"); | ||
362 | result = -EOPNOTSUPP; | ||
363 | goto EXIT; | ||
364 | case I2C_SMBUS_QUICK: | 360 | case I2C_SMBUS_QUICK: |
365 | outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), | 361 | outb_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
366 | SMBHSTADD); | 362 | SMBHSTADD); |
@@ -418,6 +414,10 @@ static s32 ali1535_access(struct i2c_adapter *adap, u16 addr, | |||
418 | outb_p(data->block[i], SMBBLKDAT); | 414 | outb_p(data->block[i], SMBBLKDAT); |
419 | } | 415 | } |
420 | break; | 416 | break; |
417 | default: | ||
418 | dev_warn(&adap->dev, "Unsupported transaction %d\n", size); | ||
419 | result = -EOPNOTSUPP; | ||
420 | goto EXIT; | ||
421 | } | 421 | } |
422 | 422 | ||
423 | result = ali1535_transaction(adap); | 423 | result = ali1535_transaction(adap); |