Skip to content

Commit

Permalink
[PATCH] i2c: bug fix for busses/i2c-mv64xxx.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jean Delvare authored and Greg Kroah-Hartman committed Sep 5, 2005
1 parent 8e14d6c commit d1b2f0a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/i2c/busses/i2c-mv64xxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -423,13 +423,13 @@ static int
mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
{
struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap);
int i, rc = 0;
int i, rc;

for (i=0; i<num; i++)
if ((rc = mv64xxx_i2c_execute_msg(drv_data, &msgs[i])) != 0)
break;
if ((rc = mv64xxx_i2c_execute_msg(drv_data, &msgs[i])) < 0)
return rc;

return rc;
return num;
}

static struct i2c_algorithm mv64xxx_i2c_algo = {
Expand Down

0 comments on commit d1b2f0a

Please sign in to comment.