diff mbox series

[42/75] media: imx: imx7-media-csi: Merge streaming_start() with csi_enable()

Message ID 20210105152852.5733-43-laurent.pinchart@ideasonboard.com (mailing list archive)
State New
Headers show
Series media: imx: Miscellaneous fixes and cleanups for i.MX7 | expand

Commit Message

Laurent Pinchart Jan. 5, 2021, 3:28 p.m. UTC
The imx7_csi_streaming_start() function just wraps imx7_csi_enable().
Call the latter directly.

Similarly, merge imx7_csi_streaming_stop() and imx7_csi_disable() as
they're both called from a single location only.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/staging/media/imx/imx7-media-csi.c | 28 +++++++---------------
 1 file changed, 8 insertions(+), 20 deletions(-)
diff mbox series

Patch

diff --git a/drivers/staging/media/imx/imx7-media-csi.c b/drivers/staging/media/imx/imx7-media-csi.c
index 7ff100e895df..8680f5d9ff71 100644
--- a/drivers/staging/media/imx/imx7-media-csi.c
+++ b/drivers/staging/media/imx/imx7-media-csi.c
@@ -610,28 +610,16 @@  static void imx7_csi_enable(struct imx7_csi *csi)
 }
 
 static void imx7_csi_disable(struct imx7_csi *csi)
-{
-	imx7_csi_dmareq_rff_disable(csi);
-
-	imx7_csi_hw_disable_irq(csi);
-
-	imx7_csi_buf_stride_set(csi, 0);
-
-	imx7_csi_hw_disable(csi);
-}
-
-static void imx7_csi_streaming_start(struct imx7_csi *csi)
-{
-	imx7_csi_enable(csi);
-}
-
-static int imx7_csi_streaming_stop(struct imx7_csi *csi)
 {
 	imx7_csi_dma_stop(csi);
 
-	imx7_csi_disable(csi);
+	imx7_csi_dmareq_rff_disable(csi);
 
-	return 0;
+	imx7_csi_hw_disable_irq(csi);
+
+	imx7_csi_buf_stride_set(csi, 0);
+
+	imx7_csi_hw_disable(csi);
 }
 
 /* -----------------------------------------------------------------------------
@@ -767,9 +755,9 @@  static int imx7_csi_s_stream(struct v4l2_subdev *sd, int enable)
 			goto out_unlock;
 		}
 
-		imx7_csi_streaming_start(csi);
+		imx7_csi_enable(csi);
 	} else {
-		imx7_csi_streaming_stop(csi);
+		imx7_csi_disable(csi);
 
 		v4l2_subdev_call(csi->src_sd, video, s_stream, 0);