[PATCH v1 04/12] i2c: tegra: Don't ignore tegra_i2c_flush_fifos() error

From: Dmitry Osipenko
Date: Mon Aug 31 2020 - 16:24:18 EST


The tegra_i2c_flush_fifos() may fail and transfer should be aborted in
this case.

Signed-off-by: Dmitry Osipenko <digetx@xxxxxxxxx>
---
drivers/i2c/busses/i2c-tegra.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index efbb20049cf8..a7ef3a93e1b5 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1181,7 +1181,9 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,
bool dma;
u16 xfer_time = 100;

- tegra_i2c_flush_fifos(i2c_dev);
+ err = tegra_i2c_flush_fifos(i2c_dev);
+ if (err)
+ return err;

i2c_dev->msg_buf = msg->buf;
i2c_dev->msg_buf_remaining = msg->len;
--
2.27.0