media: mc: Rename pad as origin in __media_pipeline_start()
authorSakari Ailus <sakari.ailus@linux.intel.com>
Sat, 19 Oct 2024 17:23:12 +0000 (20:23 +0300)
committerHans Verkuil <hverkuil@xs4all.nl>
Thu, 7 Nov 2024 08:05:58 +0000 (09:05 +0100)
Rename the pad field in __media_pipeline_start() to both better describe
what it is and avoid masking it during the loop.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/mc/mc-entity.c
include/media/media-entity.h

index 96dd0f6ccd0d0ae96af84a8620e1ec07945e607d..045590905582054c46656e20463271b1f93fa6b4 100644 (file)
@@ -768,10 +768,10 @@ done:
        return ret;
 }
 
-__must_check int __media_pipeline_start(struct media_pad *pad,
+__must_check int __media_pipeline_start(struct media_pad *origin,
                                        struct media_pipeline *pipe)
 {
-       struct media_device *mdev = pad->graph_obj.mdev;
+       struct media_device *mdev = origin->graph_obj.mdev;
        struct media_pipeline_pad *err_ppad;
        struct media_pipeline_pad *ppad;
        int ret;
@@ -782,7 +782,7 @@ __must_check int __media_pipeline_start(struct media_pad *pad,
         * If the pad is already part of a pipeline, that pipeline must be the
         * same as the pipe given to media_pipeline_start().
         */
-       if (WARN_ON(pad->pipe && pad->pipe != pipe))
+       if (WARN_ON(origin->pipe && origin->pipe != pipe))
                return -EINVAL;
 
        /*
@@ -799,7 +799,7 @@ __must_check int __media_pipeline_start(struct media_pad *pad,
         * with media_pipeline_pad instances for each pad found during graph
         * walk.
         */
-       ret = media_pipeline_populate(pipe, pad);
+       ret = media_pipeline_populate(pipe, origin);
        if (ret)
                return ret;
 
@@ -914,14 +914,14 @@ error:
 }
 EXPORT_SYMBOL_GPL(__media_pipeline_start);
 
-__must_check int media_pipeline_start(struct media_pad *pad,
+__must_check int media_pipeline_start(struct media_pad *origin,
                                      struct media_pipeline *pipe)
 {
-       struct media_device *mdev = pad->graph_obj.mdev;
+       struct media_device *mdev = origin->graph_obj.mdev;
        int ret;
 
        mutex_lock(&mdev->graph_mutex);
-       ret = __media_pipeline_start(pad, pipe);
+       ret = __media_pipeline_start(origin, pipe);
        mutex_unlock(&mdev->graph_mutex);
        return ret;
 }
index 0393b23129eb9f2bc9415f29fc5d75030fc8f2b0..64cf590b11343f68a456c5870ca2f32917c122f9 100644 (file)
@@ -1143,10 +1143,10 @@ struct media_entity *media_graph_walk_next(struct media_graph *graph);
 
 /**
  * media_pipeline_start - Mark a pipeline as streaming
- * @pad: Starting pad
+ * @origin: Starting pad
  * @pipe: Media pipeline to be assigned to all pads in the pipeline.
  *
- * Mark all pads connected to a given pad through enabled links, either
+ * Mark all pads connected to pad @origin through enabled links, either
  * directly or indirectly, as streaming. The given pipeline object is assigned
  * to every pad in the pipeline and stored in the media_pad pipe field.
  *
@@ -1155,17 +1155,17 @@ struct media_entity *media_graph_walk_next(struct media_graph *graph);
  * pipeline pointer must be identical for all nested calls to
  * media_pipeline_start().
  */
-__must_check int media_pipeline_start(struct media_pad *pad,
+__must_check int media_pipeline_start(struct media_pad *origin,
                                      struct media_pipeline *pipe);
 /**
  * __media_pipeline_start - Mark a pipeline as streaming
  *
- * @pad: Starting pad
+ * @origin: Starting pad
  * @pipe: Media pipeline to be assigned to all pads in the pipeline.
  *
  * ..note:: This is the non-locking version of media_pipeline_start()
  */
-__must_check int __media_pipeline_start(struct media_pad *pad,
+__must_check int __media_pipeline_start(struct media_pad *origin,
                                        struct media_pipeline *pipe);
 
 /**