aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2017-11-09 23:20:53 +0100
committerWolfram Sang <wsa@the-dreams.de>2017-11-27 18:53:23 +0100
commit2967f9ca8b0dc8d924e0f14c55d1e73d9c6c4975 (patch)
tree891e30dc943c7fd3e3d9c92119067869b1b4d2bf /drivers/i2c/busses
parenti2c: sh_mobile: let RuntimePM do the clock handling (diff)
downloadlinux-dev-2967f9ca8b0dc8d924e0f14c55d1e73d9c6c4975.tar.xz
linux-dev-2967f9ca8b0dc8d924e0f14c55d1e73d9c6c4975.zip
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 <wsa+renesas@sang-engineering.com> Tested-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
Diffstat (limited to 'drivers/i2c/busses')
-rw-r--r--drivers/i2c/busses/i2c-sh_mobile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c
index 80561ffbcf7b..40a66d466c3c 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;