i2c: rcar_i2c: Don't mask errors with EREMOTEIO at rcar_i2c_xfer
authorIsmael Luceno Cortes <ismael.luceno@silicon-gears.com>
Thu, 7 Mar 2019 18:00:53 +0000 (18:00 +0000)
committerHeiko Schocher <hs@denx.de>
Fri, 8 Mar 2019 04:53:23 +0000 (05:53 +0100)
Fix rcar_i2c_xfer return value, previously it was always returning
-EREMOTEIO when dealing with errors from calls to the read/write
functions.

Signed-off-by: Ismael Luceno <ismael.luceno@silicon-gears.com>
Reviewed-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Reviewed-by: Heiko Schocher <hs@denx.de>
drivers/i2c/rcar_i2c.c

index a88fbcf34f394508345e0c69d9931131acffd829..9223eaecbf6e8bc9c5a60d282d5a3a014e24abd9 100644 (file)
@@ -221,7 +221,7 @@ static int rcar_i2c_xfer(struct udevice *dev, struct i2c_msg *msg, int nmsgs)
                        ret = rcar_i2c_write_common(dev, msg);
 
                if (ret)
-                       return -EREMOTEIO;
+                       return ret;
        }
 
        return ret;