diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2019-01-16 22:05:49 +0100 |
---|---|---|
committer | Wolfram Sang <wsa@the-dreams.de> | 2019-01-23 00:18:07 +0100 |
commit | 5b3e3b43b03bf84f1656c2f7afda6b73f945cc82 (patch) | |
tree | 1a015e04063c7e5b8f5339f8f5f2323f4cb0deca /drivers/i2c/busses/i2c-sh_mobile.c | |
parent | i2c: rcar: Fix clients using i2c from suspend callback (diff) | |
download | linux-5b3e3b43b03bf84f1656c2f7afda6b73f945cc82.tar.xz linux-5b3e3b43b03bf84f1656c2f7afda6b73f945cc82.zip |
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>
Diffstat (limited to 'drivers/i2c/busses/i2c-sh_mobile.c')
-rw-r--r-- | drivers/i2c/busses/i2c-sh_mobile.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-sh_mobile.c b/drivers/i2c/busses/i2c-sh_mobile.c index a64f2ff3cb49..e18e3cedf817 100644 --- a/drivers/i2c/busses/i2c-sh_mobile.c +++ b/drivers/i2c/busses/i2c-sh_mobile.c @@ -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; } |