diff mbox series

[v1,1/2] media: mc: Get media_device directly from pad

Message ID 20221212132505.9251-2-laurent.pinchart@ideasonboard.com
State Accepted
Commit a967a3a788028f541e4db54beabcebc3648997db
Headers show
Series media: Minor fixes for media pipeline start rework | expand

Commit Message

Laurent Pinchart Dec. 12, 2022, 1:25 p.m. UTC
Various functions access the media_device from a pad by going through
the entity the pad belongs to. Remove the level of indirection and get
the media_device from the pad directly.

Fixes: 9e3576a1ae2b ("media: mc: convert pipeline funcs to take media_pad")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/media/mc/mc-entity.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Tomi Valkeinen Dec. 13, 2022, 6:49 a.m. UTC | #1
On 12/12/2022 15:25, Laurent Pinchart wrote:
> Various functions access the media_device from a pad by going through
> the entity the pad belongs to. Remove the level of indirection and get
> the media_device from the pad directly.
> 
> Fixes: 9e3576a1ae2b ("media: mc: convert pipeline funcs to take media_pad")
> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> ---
>   drivers/media/mc/mc-entity.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>

  Tomi

> diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
> index b8bcbc734eaf..f268cf66053e 100644
> --- a/drivers/media/mc/mc-entity.c
> +++ b/drivers/media/mc/mc-entity.c
> @@ -703,7 +703,7 @@ static int media_pipeline_populate(struct media_pipeline *pipe,
>   __must_check int __media_pipeline_start(struct media_pad *pad,
>   					struct media_pipeline *pipe)
>   {
> -	struct media_device *mdev = pad->entity->graph_obj.mdev;
> +	struct media_device *mdev = pad->graph_obj.mdev;
>   	struct media_pipeline_pad *err_ppad;
>   	struct media_pipeline_pad *ppad;
>   	int ret;
> @@ -851,7 +851,7 @@ EXPORT_SYMBOL_GPL(__media_pipeline_start);
>   __must_check int media_pipeline_start(struct media_pad *pad,
>   				      struct media_pipeline *pipe)
>   {
> -	struct media_device *mdev = pad->entity->graph_obj.mdev;
> +	struct media_device *mdev = pad->graph_obj.mdev;
>   	int ret;
>   
>   	mutex_lock(&mdev->graph_mutex);
> @@ -888,7 +888,7 @@ EXPORT_SYMBOL_GPL(__media_pipeline_stop);
>   
>   void media_pipeline_stop(struct media_pad *pad)
>   {
> -	struct media_device *mdev = pad->entity->graph_obj.mdev;
> +	struct media_device *mdev = pad->graph_obj.mdev;
>   
>   	mutex_lock(&mdev->graph_mutex);
>   	__media_pipeline_stop(pad);
> @@ -898,7 +898,7 @@ EXPORT_SYMBOL_GPL(media_pipeline_stop);
>   
>   __must_check int media_pipeline_alloc_start(struct media_pad *pad)
>   {
> -	struct media_device *mdev = pad->entity->graph_obj.mdev;
> +	struct media_device *mdev = pad->graph_obj.mdev;
>   	struct media_pipeline *new_pipe = NULL;
>   	struct media_pipeline *pipe;
>   	int ret;
diff mbox series

Patch

diff --git a/drivers/media/mc/mc-entity.c b/drivers/media/mc/mc-entity.c
index b8bcbc734eaf..f268cf66053e 100644
--- a/drivers/media/mc/mc-entity.c
+++ b/drivers/media/mc/mc-entity.c
@@ -703,7 +703,7 @@  static int media_pipeline_populate(struct media_pipeline *pipe,
 __must_check int __media_pipeline_start(struct media_pad *pad,
 					struct media_pipeline *pipe)
 {
-	struct media_device *mdev = pad->entity->graph_obj.mdev;
+	struct media_device *mdev = pad->graph_obj.mdev;
 	struct media_pipeline_pad *err_ppad;
 	struct media_pipeline_pad *ppad;
 	int ret;
@@ -851,7 +851,7 @@  EXPORT_SYMBOL_GPL(__media_pipeline_start);
 __must_check int media_pipeline_start(struct media_pad *pad,
 				      struct media_pipeline *pipe)
 {
-	struct media_device *mdev = pad->entity->graph_obj.mdev;
+	struct media_device *mdev = pad->graph_obj.mdev;
 	int ret;
 
 	mutex_lock(&mdev->graph_mutex);
@@ -888,7 +888,7 @@  EXPORT_SYMBOL_GPL(__media_pipeline_stop);
 
 void media_pipeline_stop(struct media_pad *pad)
 {
-	struct media_device *mdev = pad->entity->graph_obj.mdev;
+	struct media_device *mdev = pad->graph_obj.mdev;
 
 	mutex_lock(&mdev->graph_mutex);
 	__media_pipeline_stop(pad);
@@ -898,7 +898,7 @@  EXPORT_SYMBOL_GPL(media_pipeline_stop);
 
 __must_check int media_pipeline_alloc_start(struct media_pad *pad)
 {
-	struct media_device *mdev = pad->entity->graph_obj.mdev;
+	struct media_device *mdev = pad->graph_obj.mdev;
 	struct media_pipeline *new_pipe = NULL;
 	struct media_pipeline *pipe;
 	int ret;