From: Wolfram Sang Date: Thu, 9 Nov 2017 22:20:53 +0000 (+0100) Subject: i2c: sh_mobile: avoid unnecessary register read X-Git-Tag: v4.16-rc1~77^2~59 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2967f9ca8b0dc8d924e0f14c55d1e73d9c6c4975;p=thirdparty%2Fkernel%2Flinux.git i2c: sh_mobile: avoid unnecessary register read There is no data when the first WAIT interrupt arrives. No need to read something then. Signed-off-by: Wolfram Sang Tested-by: Jacopo Mondi Signed-off-by: Wolfram Sang --- diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index 80561ffbcf7b4..40a66d466c3c4 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -433,8 +433,9 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd) break; } data = i2c_op(pd, OP_RX_STOP_DATA, 0); - } else + } else if (real_pos >= 0) { data = i2c_op(pd, OP_RX, 0); + } if (real_pos >= 0) pd->msg->buf[real_pos] = data;