diff options
author | Dmitry Osipenko <digetx@gmail.com> | 2020-09-30 01:18:46 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2020-10-05 23:57:39 +0300 |
commit | c5418d4cc9f028f3f0fc61c62c781e020113108f (patch) | |
tree | 106a0f4e8e8236384ccda067b3ad6ebf167a1001 /drivers/i2c | |
parent | e4fc2efbc310cfb665eed558da42ac18084d20bc (diff) | |
download | linux-c5418d4cc9f028f3f0fc61c62c781e020113108f.tar.xz |
i2c: tegra: Handle potential error of tegra_i2c_flush_fifos()
Technically the tegra_i2c_flush_fifos() may fail and transfer should be
aborted in this case, but this shouldn't ever happen in practice unless
there is a bug somewhere in the driver. Let's add the error check just
for completeness.
Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Reviewed-by: Thierry Reding <treding@nvidia.com>
Tested-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-tegra.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c index 4e7d0eec0dd3..88d6e7bb14a2 100644 --- a/drivers/i2c/busses/i2c-tegra.c +++ b/drivers/i2c/busses/i2c-tegra.c @@ -1177,7 +1177,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; |