blob: 866b3209ce46084322f689f4d88ca981f27413a2 [file] [log] [blame]
From afa2b3d18bedd1ceb702cfffd5ab9d8a91bf1210 Mon Sep 17 00:00:00 2001
From: Wolfram Sang <wsa+renesas@sang-engineering.com>
Date: Thu, 9 Nov 2017 23:20:53 +0100
Subject: [PATCH 0424/1795] 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>
(cherry picked from commit 2967f9ca8b0dc8d924e0f14c55d1e73d9c6c4975)
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/i2c/busses/i2c-sh_mobile.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
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;
--
2.19.0