i2c: sh_mobile: simplify sending address for RX

pd->pos won't be smaller than -1, so we can simplify the logic.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
This commit is contained in:
Wolfram Sang 2019-01-16 22:05:49 +01:00 committed by Wolfram Sang
parent 81d696c7c4
commit 5b3e3b43b0
1 changed files with 2 additions and 6 deletions

View File

@ -392,13 +392,9 @@ static int sh_mobile_i2c_isr_rx(struct sh_mobile_i2c_data *pd)
int real_pos;
do {
if (pd->pos <= -1) {
if (sh_mobile_i2c_is_first_byte(pd)) {
sh_mobile_i2c_get_data(pd, &data);
if (sh_mobile_i2c_is_first_byte(pd))
i2c_op(pd, OP_TX_FIRST, data);
else
i2c_op(pd, OP_TX, data);
i2c_op(pd, OP_TX_FIRST, data);
break;
}