diff mbox series

[v3,04/22] i2c: tegra: Don't ignore tegra_i2c_flush_fifos() error

Message ID 20200903005300.7894-5-digetx@gmail.com
State New
Headers show
Series Improvements for Tegra I2C driver | expand

Commit Message

Dmitry Osipenko Sept. 3, 2020, 12:52 a.m. UTC
The tegra_i2c_flush_fifos() may fail and transfer should be aborted in
this case.

Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
 drivers/i2c/busses/i2c-tegra.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Andy Shevchenko Sept. 3, 2020, 11:09 a.m. UTC | #1
On Thu, Sep 3, 2020 at 3:53 AM Dmitry Osipenko <digetx@gmail.com> wrote:
>
> The tegra_i2c_flush_fifos() may fail and transfer should be aborted in
> this case.

Sounds like a fix. To add to previous comment, fixes that are likely
to be backported should have Fixes: tags.

> Reviewed-by: Michał Mirosław <mirq-linux@rere.qmqm.pl>
> Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
> ---
>  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 79e542cf3e59..b912a7153e3b 100644
> --- a/drivers/i2c/busses/i2c-tegra.c
> +++ b/drivers/i2c/busses/i2c-tegra.c
> @@ -1189,7 +1189,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
>
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
index 79e542cf3e59..b912a7153e3b 100644
--- a/drivers/i2c/busses/i2c-tegra.c
+++ b/drivers/i2c/busses/i2c-tegra.c
@@ -1189,7 +1189,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;