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>
This commit is contained in:
Wolfram Sang 2017-11-09 23:20:53 +01:00 committed by Wolfram Sang
parent 91701ae85d
commit 2967f9ca8b

View File

@ -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;