From: Laurent Pinchart Date: Wed, 13 Aug 2025 21:24:51 +0000 (+0300) Subject: media: nxp: imx8-isi: Drop mxc_isi_video.is_streaming field X-Git-Tag: v6.18-rc1~133^2~216 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=15b5936343099dbf8c31c3c0c9fcd898fd503694;p=thirdparty%2Fkernel%2Fstable.git media: nxp: imx8-isi: Drop mxc_isi_video.is_streaming field The mxc_isi_video.is_streaming field is used to track the streaming status of the video device. The same information is also tracked by the videobuf2 queue. Drop the is_streaming field, and check the queue streaming status instead. Link: https://lore.kernel.org/r/20250813212451.22140-3-laurent.pinchart@ideasonboard.com Signed-off-by: Laurent Pinchart Tested-by: Richard Leitner # i.MX8MP Signed-off-by: Hans Verkuil --- diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h index 206995bedca4a..d86f5ede0c0e9 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-core.h @@ -202,9 +202,8 @@ struct mxc_isi_video { struct video_device vdev; struct media_pad pad; - /* Protects is_streaming, and the vdev and vb2_q operations */ + /* Protects the vdev and vb2_q operations */ struct mutex lock; - bool is_streaming; struct v4l2_pix_format_mplane pix; const struct mxc_isi_format_info *fmtinfo; diff --git a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c index 042b554d2775a..13682bf6e9f88 100644 --- a/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c +++ b/drivers/media/platform/nxp/imx8-isi/imx8-isi-video.c @@ -969,8 +969,6 @@ static int mxc_isi_vb2_prepare_streaming(struct vb2_queue *q) if (ret) goto err_stop; - video->is_streaming = true; - return 0; err_stop: @@ -1035,8 +1033,6 @@ static void mxc_isi_vb2_unprepare_streaming(struct vb2_queue *q) mxc_isi_video_free_discard_buffers(video); video_device_pipeline_stop(&video->vdev); mxc_isi_pipe_release(video->pipe); - - video->is_streaming = false; } static const struct vb2_ops mxc_isi_vb2_qops = { @@ -1317,7 +1313,7 @@ void mxc_isi_video_suspend(struct mxc_isi_pipe *pipe) { struct mxc_isi_video *video = &pipe->video; - if (!video->is_streaming) + if (!vb2_is_streaming(&video->vb2_q)) return; mxc_isi_pipe_disable(pipe); @@ -1348,7 +1344,7 @@ int mxc_isi_video_resume(struct mxc_isi_pipe *pipe) { struct mxc_isi_video *video = &pipe->video; - if (!video->is_streaming) + if (!vb2_is_streaming(&video->vb2_q)) return 0; mxc_isi_video_init_channel(video);