summaryrefslogtreecommitdiffstats
path: root/drivers/media/mc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2022-01-13 17:00:41 +0200
committerSakari Ailus <sakari.ailus@linux.intel.com>2022-03-04 00:27:06 +0200
commitf17bc788f7b97c36b8f3fbef14555a2a16ee3f69 (patch)
tree0900729130e4d0100d67bcc9123b32b98b15dcb7 /drivers/media/mc
parent472377febf848a08f67ed73bb0dc13a907575f82 (diff)
downloadlinux-f17bc788f7b97c36b8f3fbef14555a2a16ee3f69.tar.bz2
media: media-entity: Add media_pad_is_streaming() helper function
Add a function to test if a pad is part of a pipeline currently streaming, and use it through drivers to replace direct access to the stream_count field. This will help reworking pipeline start/stop without disturbing drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Diffstat (limited to 'drivers/media/mc')
-rw-r--r--drivers/media/mc/mc-entity.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index b411f9796191..f83e043f0f3b 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -834,7 +834,8 @@ int __media_entity_setup_link(struct media_link *link, u32 flags)
sink = link->sink->entity;
if (!(link->flags & MEDIA_LNK_FL_DYNAMIC) &&
- (source->stream_count || sink->stream_count))
+ (media_entity_is_streaming(source) ||
+ media_entity_is_streaming(sink)))
return -EBUSY;
mdev = source->graph_obj.mdev;