[v13,04/34] media: mc: entity: Rename streaming_count -> start_count
Commit Message
'streaming_count' is a bit misleading name, as the count is increased
with media_pipeline_start(). Let's rename it to 'start_count' instead.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
---
drivers/media/mc/mc-entity.c | 8 ++++----
drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 4 ++--
include/media/media-entity.h | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
Comments
Hi Tomi,
Thank you for the patch.
On Wed, Aug 10, 2022 at 03:10:52PM +0300, Tomi Valkeinen wrote:
> 'streaming_count' is a bit misleading name, as the count is increased
> with media_pipeline_start(). Let's rename it to 'start_count' instead.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
> drivers/media/mc/mc-entity.c | 8 ++++----
> drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c | 4 ++--
> include/media/media-entity.h | 4 ++--
> 3 files changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
> index 11f5207f73aa..d284f616a456 100644
> --- a/drivers/media/mc/mc-entity.c
> +++ b/drivers/media/mc/mc-entity.c
> @@ -414,8 +414,8 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
> struct media_link *link;
> int ret;
>
> - if (pipe->streaming_count) {
> - pipe->streaming_count++;
> + if (pipe->start_count) {
> + pipe->start_count++;
> return 0;
> }
>
> @@ -498,7 +498,7 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
> }
> }
>
> - pipe->streaming_count++;
> + pipe->start_count++;
>
> return 0;
>
> @@ -551,7 +551,7 @@ void __media_pipeline_stop(struct media_entity *entity)
> if (WARN_ON(!pipe))
> return;
>
> - if (--pipe->streaming_count)
> + if (--pipe->start_count)
> return;
>
> media_graph_walk_start(graph, entity);
> diff --git a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> index fee2aaacb26b..0ebd70275e23 100644
> --- a/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> +++ b/drivers/media/platform/rockchip/rkisp1/rkisp1-capture.c
> @@ -931,7 +931,7 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
> * If the other capture is streaming, isp and sensor nodes shouldn't
> * be disabled, skip them.
> */
> - if (rkisp1->pipe.streaming_count < 2) {
> + if (rkisp1->pipe.start_count < 2) {
> v4l2_subdev_call(rkisp1->active_sensor->sd, video, s_stream,
> false);
> v4l2_subdev_call(&rkisp1->isp.sd, video, s_stream, false);
> @@ -964,7 +964,7 @@ static int rkisp1_pipeline_stream_enable(struct rkisp1_capture *cap)
> * If the other capture is streaming, isp and sensor nodes are already
> * enabled, skip them.
> */
> - if (rkisp1->pipe.streaming_count > 1)
> + if (rkisp1->pipe.start_count > 1)
> return 0;
>
> ret = v4l2_subdev_call(&rkisp1->isp.sd, video, s_stream, true);
> diff --git a/include/media/media-entity.h b/include/media/media-entity.h
> index 3e3d06c1ec36..68a8ecb2b397 100644
> --- a/include/media/media-entity.h
> +++ b/include/media/media-entity.h
> @@ -100,11 +100,11 @@ struct media_graph {
> /**
> * struct media_pipeline - Media pipeline related information
> *
> - * @streaming_count: Streaming start count - streaming stop count
> + * @start_count: Media pipeline start - stop count
> * @graph: Media graph walk during pipeline start / stop
> */
> struct media_pipeline {
> - int streaming_count;
> + int start_count;
> struct media_graph graph;
> };
>
@@ -414,8 +414,8 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
struct media_link *link;
int ret;
- if (pipe->streaming_count) {
- pipe->streaming_count++;
+ if (pipe->start_count) {
+ pipe->start_count++;
return 0;
}
@@ -498,7 +498,7 @@ __must_check int __media_pipeline_start(struct media_entity *entity,
}
}
- pipe->streaming_count++;
+ pipe->start_count++;
return 0;
@@ -551,7 +551,7 @@ void __media_pipeline_stop(struct media_entity *entity)
if (WARN_ON(!pipe))
return;
- if (--pipe->streaming_count)
+ if (--pipe->start_count)
return;
media_graph_walk_start(graph, entity);
@@ -931,7 +931,7 @@ static void rkisp1_pipeline_stream_disable(struct rkisp1_capture *cap)
* If the other capture is streaming, isp and sensor nodes shouldn't
* be disabled, skip them.
*/
- if (rkisp1->pipe.streaming_count < 2) {
+ if (rkisp1->pipe.start_count < 2) {
v4l2_subdev_call(rkisp1->active_sensor->sd, video, s_stream,
false);
v4l2_subdev_call(&rkisp1->isp.sd, video, s_stream, false);
@@ -964,7 +964,7 @@ static int rkisp1_pipeline_stream_enable(struct rkisp1_capture *cap)
* If the other capture is streaming, isp and sensor nodes are already
* enabled, skip them.
*/
- if (rkisp1->pipe.streaming_count > 1)
+ if (rkisp1->pipe.start_count > 1)
return 0;
ret = v4l2_subdev_call(&rkisp1->isp.sd, video, s_stream, true);
@@ -100,11 +100,11 @@ struct media_graph {
/**
* struct media_pipeline - Media pipeline related information
*
- * @streaming_count: Streaming start count - streaming stop count
+ * @start_count: Media pipeline start - stop count
* @graph: Media graph walk during pipeline start / stop
*/
struct media_pipeline {
- int streaming_count;
+ int start_count;
struct media_graph graph;
};