summaryrefslogtreecommitdiff
path: root/drivers/i2c/busses/i2c-amd756.c
diff options
context:
space:
mode:
authorJean Delvare <khali@linux-fr.org>2008-07-15 00:38:25 +0400
committerJean Delvare <khali@mahadeva.delvare>2008-07-15 00:38:25 +0400
commitac7fc4fb2b6a126af8d07f46500440c9641976cf (patch)
tree1ba7a6b229699f6d69cfe3f1bd74c020e952e16b /drivers/i2c/busses/i2c-amd756.c
parentfa63cd56d2f09806169307d761e8f430e23bc09b (diff)
downloadlinux-ac7fc4fb2b6a126af8d07f46500440c9641976cf.tar.xz
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-amd756.c')
-rw-r--r--drivers/i2c/busses/i2c-amd756.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/drivers/i2c/busses/i2c-amd756.c b/drivers/i2c/busses/i2c-amd756.c
index 3d5bcb65e9e0..f0baea62067d 100644
--- a/drivers/i2c/busses/i2c-amd756.c
+++ b/drivers/i2c/busses/i2c-amd756.c
@@ -200,12 +200,7 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
int i, len;
int status;
- /** TODO: Should I supporte the 10-bit transfers? */
switch (size) {
- case I2C_SMBUS_PROC_CALL:
- dev_dbg(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n");
- /* TODO: Well... It is supported, I'm just not sure what to do here... */
- return -EOPNOTSUPP;
case I2C_SMBUS_QUICK:
outw_p(((addr & 0x7f) << 1) | (read_write & 0x01),
SMB_HOST_ADDRESS);
@@ -252,6 +247,9 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr,
}
size = AMD756_BLOCK_DATA;
break;
+ default:
+ dev_warn(&adap->dev, "Unsupported transaction %d\n", size);
+ return -EOPNOTSUPP;
}
/* How about enabling interrupts... */