Message ID | 1321947740.2476.0.camel@phoenix |
---|---|
State | Accepted |
Delegated to: | David Miller |
Headers | show |
From: Axel Lin <axel.lin@gmail.com> Date: Tue, 22 Nov 2011 15:42:20 +0800 > Signed-off-by: Axel Lin <axel.lin@gmail.com> Applied. -- To unsubscribe from this list: send the line "unsubscribe sparclinux" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/sbus/char/bbc_i2c.c b/drivers/sbus/char/bbc_i2c.c index 5f94d22..a0d1399 100644 --- a/drivers/sbus/char/bbc_i2c.c +++ b/drivers/sbus/char/bbc_i2c.c @@ -233,13 +233,9 @@ int bbc_i2c_write_buf(struct bbc_i2c_client *client, int ret = 0; while (len > 0) { - int err = bbc_i2c_writeb(client, *buf, off); - - if (err < 0) { - ret = err; + ret = bbc_i2c_writeb(client, *buf, off); + if (ret < 0) break; - } - len--; buf++; off++; @@ -253,11 +249,9 @@ int bbc_i2c_read_buf(struct bbc_i2c_client *client, int ret = 0; while (len > 0) { - int err = bbc_i2c_readb(client, buf, off); - if (err < 0) { - ret = err; + ret = bbc_i2c_readb(client, buf, off); + if (ret < 0) break; - } len--; buf++; off++;
Signed-off-by: Axel Lin <axel.lin@gmail.com> --- drivers/sbus/char/bbc_i2c.c | 14 ++++---------- 1 files changed, 4 insertions(+), 10 deletions(-)