Skip to content

Commit

Permalink
[PATCH] I2C: Fix sgi_xfer return value
Browse files Browse the repository at this point in the history
The sgi_xfer function returns 0 on success instead of the number of
transfered messages as it is supposed to. This patch fixes that.

Let's just hope that no client chip driver was relying on this
misbehavior.

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 d1b2f0a commit a89923f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/i2c/algos/i2c-algo-sgi.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ static int sgi_xfer(struct i2c_adapter *i2c_adap, struct i2c_msg *msgs,
err = i2c_write(adap, p->buf, p->len);
}

return err;
return (err < 0) ? err : i;
}

static u32 sgi_func(struct i2c_adapter *adap)
Expand Down

0 comments on commit a89923f

Please sign in to comment.