diff mbox series

[v2,4/5] media: i2c: ov5645: Return zero for s_stream(0)

Message ID 20221014183459.181567-5-prabhakar.mahadev-lad.rj@bp.renesas.com
State New
Headers show
Series media: i2c: ov5645 driver enhancements | expand

Commit Message

Lad, Prabhakar Oct. 14, 2022, 6:34 p.m. UTC
From: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>

Always return zero while stopping the stream as the caller will ignore the
return value.

This patch drops checking the return value of ov5645_write_reg() and
continues further in the code path while stopping stream. The user anyway
gets an error message in case ov5645_write_reg() fails.

Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
---
v1->v2
* New patch
---
 drivers/media/i2c/ov5645.c | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/drivers/media/i2c/ov5645.c b/drivers/media/i2c/ov5645.c
index a0b9d0c43b78..b3825294aaf1 100644
--- a/drivers/media/i2c/ov5645.c
+++ b/drivers/media/i2c/ov5645.c
@@ -995,14 +995,11 @@  static int ov5645_s_stream(struct v4l2_subdev *subdev, int enable)
 		if (ret < 0)
 			goto err_rpm_put;
 	} else {
-		ret = ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40);
-		if (ret < 0)
-			return ret;
+		ov5645_write_reg(ov5645, OV5645_IO_MIPI_CTRL00, 0x40);
+
+		ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0,
+				 OV5645_SYSTEM_CTRL0_STOP);
 
-		ret = ov5645_write_reg(ov5645, OV5645_SYSTEM_CTRL0,
-				       OV5645_SYSTEM_CTRL0_STOP);
-		if (ret < 0)
-			return ret;
 		pm_runtime_put(ov5645->dev);
 	}