summaryrefslogtreecommitdiffstats
path: root/drivers/media/v4l2-core
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2024-04-24 17:39:05 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2024-06-04 08:31:24 +0200
commit68e36241b74683e36533b0089966881d0b7d866b (patch)
tree90b94f09d7271ceb47001fc24a52416ddf575ded /drivers/media/v4l2-core
parentmedia: subdev: Add privacy led helpers (diff)
downloadlinux-68e36241b74683e36533b0089966881d0b7d866b.tar.xz
linux-68e36241b74683e36533b0089966881d0b7d866b.zip
media: subdev: Use v4l2_subdev_has_op() in v4l2_subdev_enable/disable_streams()
Use v4l2_subdev_has_op() in v4l2_subdev_enable/disable_streams() instead of open coding the same. Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Tested-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/v4l2-core')
-rw-r--r--drivers/media/v4l2-core/v4l2-subdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/media/v4l2-core/v4l2-subdev.c b/drivers/media/v4l2-core/v4l2-subdev.c
index 2fa4a48dad20..56df3906eee6 100644
--- a/drivers/media/v4l2-core/v4l2-subdev.c
+++ b/drivers/media/v4l2-core/v4l2-subdev.c
@@ -2188,7 +2188,7 @@ int v4l2_subdev_enable_streams(struct v4l2_subdev *sd, u32 pad,
return 0;
/* Fallback on .s_stream() if .enable_streams() isn't available. */
- if (!sd->ops->pad || !sd->ops->pad->enable_streams)
+ if (!v4l2_subdev_has_op(sd, pad, enable_streams))
return v4l2_subdev_enable_streams_fallback(sd, pad,
streams_mask);
@@ -2305,7 +2305,7 @@ int v4l2_subdev_disable_streams(struct v4l2_subdev *sd, u32 pad,
return 0;
/* Fallback on .s_stream() if .disable_streams() isn't available. */
- if (!sd->ops->pad || !sd->ops->pad->disable_streams)
+ if (!v4l2_subdev_has_op(sd, pad, disable_streams))
return v4l2_subdev_disable_streams_fallback(sd, pad,
streams_mask);