diff mbox series

[v5,4/8] media: i2c: ov2659: fix s_stream return value

Message ID 20190930130644.8704-5-bparrot@ti.com (mailing list archive)
State New, archived
Headers show
Series media: i2c: ov2659: maintenance series | expand

Commit Message

Benoit Parrot Sept. 30, 2019, 1:06 p.m. UTC
In ov2659_s_stream() return value for invoked function should be checked
and propagated.

Signed-off-by: Benoit Parrot <bparrot@ti.com>
---
 drivers/media/i2c/ov2659.c | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

Comments

Lad, Prabhakar Oct. 1, 2019, 6:04 a.m. UTC | #1
On Mon, Sep 30, 2019 at 2:07 PM Benoit Parrot <bparrot@ti.com> wrote:
>
> In ov2659_s_stream() return value for invoked function should be checked
> and propagated.
>
> Signed-off-by: Benoit Parrot <bparrot@ti.com>
> ---
>  drivers/media/i2c/ov2659.c | 14 +++++++++-----
>  1 file changed, 9 insertions(+), 5 deletions(-)
>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>

Cheers,
--Prabhakar Lad

> diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
> index f77320e8a60d..da181a13cf44 100644
> --- a/drivers/media/i2c/ov2659.c
> +++ b/drivers/media/i2c/ov2659.c
> @@ -1187,11 +1187,15 @@ static int ov2659_s_stream(struct v4l2_subdev *sd, int on)
>                 goto unlock;
>         }
>
> -       ov2659_set_pixel_clock(ov2659);
> -       ov2659_set_frame_size(ov2659);
> -       ov2659_set_format(ov2659);
> -       ov2659_set_streaming(ov2659, 1);
> -       ov2659->streaming = on;
> +       ret = ov2659_set_pixel_clock(ov2659);
> +       if (!ret)
> +               ret = ov2659_set_frame_size(ov2659);
> +       if (!ret)
> +               ret = ov2659_set_format(ov2659);
> +       if (!ret) {
> +               ov2659_set_streaming(ov2659, 1);
> +               ov2659->streaming = on;
> +       }
>
>  unlock:
>         mutex_unlock(&ov2659->lock);
> --
> 2.17.1
>
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov2659.c b/drivers/media/i2c/ov2659.c
index f77320e8a60d..da181a13cf44 100644
--- a/drivers/media/i2c/ov2659.c
+++ b/drivers/media/i2c/ov2659.c
@@ -1187,11 +1187,15 @@  static int ov2659_s_stream(struct v4l2_subdev *sd, int on)
 		goto unlock;
 	}
 
-	ov2659_set_pixel_clock(ov2659);
-	ov2659_set_frame_size(ov2659);
-	ov2659_set_format(ov2659);
-	ov2659_set_streaming(ov2659, 1);
-	ov2659->streaming = on;
+	ret = ov2659_set_pixel_clock(ov2659);
+	if (!ret)
+		ret = ov2659_set_frame_size(ov2659);
+	if (!ret)
+		ret = ov2659_set_format(ov2659);
+	if (!ret) {
+		ov2659_set_streaming(ov2659, 1);
+		ov2659->streaming = on;
+	}
 
 unlock:
 	mutex_unlock(&ov2659->lock);