diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-09-02 15:25:47 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 12:26:53 -0400 |
commit | d1b2f0a9754d3087ee29b3e88b8f20f2d30090d3 (patch) | |
tree | 292f29b437f14c9af06ac276be48004ec1df8460 /drivers/i2c | |
parent | 8e14d6c173f8fff05a94e62669c87c26141766af (diff) |
[PATCH] i2c: bug fix for busses/i2c-mv64xxx.c
When an i2c transfer is successful, an incorrect value is returned.
This patch fixes that.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index eb6cc0869938..99abca45fece 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -423,13 +423,13 @@ static int | |||
423 | mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) | 423 | mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num) |
424 | { | 424 | { |
425 | struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap); | 425 | struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap); |
426 | int i, rc = 0; | 426 | int i, rc; |
427 | 427 | ||
428 | for (i=0; i<num; i++) | 428 | for (i=0; i<num; i++) |
429 | if ((rc = mv64xxx_i2c_execute_msg(drv_data, &msgs[i])) != 0) | 429 | if ((rc = mv64xxx_i2c_execute_msg(drv_data, &msgs[i])) < 0) |
430 | break; | 430 | return rc; |
431 | 431 | ||
432 | return rc; | 432 | return num; |
433 | } | 433 | } |
434 | 434 | ||
435 | static struct i2c_algorithm mv64xxx_i2c_algo = { | 435 | static struct i2c_algorithm mv64xxx_i2c_algo = { |