]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
i2c: sh_mobile: simplify sending address for RX
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Wed, 16 Jan 2019 21:05:49 +0000 (22:05 +0100)
committerWolfram Sang <wsa@the-dreams.de>
Tue, 22 Jan 2019 23:18:07 +0000 (00:18 +0100)
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>
drivers/i2c/busses/i2c-sh_mobile.c

index a64f2ff3cb49ce47b41dda39d00bf92e532cab75..e18e3cedf8175076e8f062fda163e42327f82db7 100644 (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;
                }