media: mc: Get media_device directly from pad
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 12 Dec 2022 13:25:04 +0000 (14:25 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Mon, 6 Feb 2023 07:36:42 +0000 (08:36 +0100)
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>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/mc/mc-entity.c

index 0b7fb0cc641ca2f33ed55294c30f5d23616e90a7..7c62d26d9797ad968268a219b9fb3ebf55348c2f 100644 (file)
@@ -716,7 +716,7 @@ done:
 __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;
@@ -864,7 +864,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);
@@ -901,7 +901,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);
@@ -911,7 +911,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;