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-amd756.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-amd756.c')
-rw-r--r-- | drivers/i2c/busses/i2c-amd756.c | 8 |
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, | |||
200 | int i, len; | 200 | int i, len; |
201 | int status; | 201 | int status; |
202 | 202 | ||
203 | /** TODO: Should I supporte the 10-bit transfers? */ | ||
204 | switch (size) { | 203 | switch (size) { |
205 | case I2C_SMBUS_PROC_CALL: | ||
206 | dev_dbg(&adap->dev, "I2C_SMBUS_PROC_CALL not supported!\n"); | ||
207 | /* TODO: Well... It is supported, I'm just not sure what to do here... */ | ||
208 | return -EOPNOTSUPP; | ||
209 | case I2C_SMBUS_QUICK: | 204 | case I2C_SMBUS_QUICK: |
210 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), | 205 | outw_p(((addr & 0x7f) << 1) | (read_write & 0x01), |
211 | SMB_HOST_ADDRESS); | 206 | SMB_HOST_ADDRESS); |
@@ -252,6 +247,9 @@ static s32 amd756_access(struct i2c_adapter * adap, u16 addr, | |||
252 | } | 247 | } |
253 | size = AMD756_BLOCK_DATA; | 248 | size = AMD756_BLOCK_DATA; |
254 | break; | 249 | break; |
250 | default: | ||
251 | dev_warn(&adap->dev, "Unsupported transaction %d\n", size); | ||
252 | return -EOPNOTSUPP; | ||
255 | } | 253 | } |
256 | 254 | ||
257 | /* How about enabling interrupts... */ | 255 | /* How about enabling interrupts... */ |