media: mc-entity: Rename media_entity_remote_pad() to media_pad_remote_pad_first()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sat, 25 Jun 2022 17:02:24 +0000 (18:02 +0100)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Sun, 17 Jul 2022 10:21:35 +0000 (11:21 +0100)
The media_entity_remote_pad() is misnamed, as it operates on a pad and
not an entity. Rename it to media_pad_remote_pad_first() to clarify its
behaviour.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
45 files changed:
Documentation/driver-api/media/mc-core.rst
drivers/media/i2c/adv748x/adv748x.h
drivers/media/i2c/tvp5150.c
drivers/media/mc/mc-entity.c
drivers/media/pci/intel/ipu3/ipu3-cio2-main.c
drivers/media/platform/qcom/camss/camss-csid.c
drivers/media/platform/qcom/camss/camss-csiphy.c
drivers/media/platform/qcom/camss/camss-ispif.c
drivers/media/platform/qcom/camss/camss-vfe.c
drivers/media/platform/qcom/camss/camss-video.c
drivers/media/platform/qcom/camss/camss.c
drivers/media/platform/renesas/rcar-vin/rcar-core.c
drivers/media/platform/renesas/rcar-vin/rcar-csi2.c
drivers/media/platform/renesas/rcar-vin/rcar-dma.c
drivers/media/platform/renesas/rcar-vin/rcar-v4l2.c
drivers/media/platform/renesas/vsp1/vsp1_entity.c
drivers/media/platform/renesas/vsp1/vsp1_video.c
drivers/media/platform/rockchip/rkisp1/rkisp1-isp.c
drivers/media/platform/samsung/exynos4-is/common.c
drivers/media/platform/samsung/exynos4-is/fimc-capture.c
drivers/media/platform/samsung/exynos4-is/fimc-isp-video.c
drivers/media/platform/samsung/exynos4-is/fimc-lite.c
drivers/media/platform/samsung/exynos4-is/media-dev.c
drivers/media/platform/samsung/s3c-camif/camif-capture.c
drivers/media/platform/st/stm32/stm32-dcmi.c
drivers/media/platform/sunxi/sun6i-csi/sun6i_video.c
drivers/media/platform/ti/cal/cal-camerarx.c
drivers/media/platform/ti/cal/cal-video.c
drivers/media/platform/ti/omap3isp/isp.c
drivers/media/platform/ti/omap3isp/ispccdc.c
drivers/media/platform/ti/omap3isp/ispccp2.c
drivers/media/platform/ti/omap3isp/ispcsi2.c
drivers/media/platform/ti/omap3isp/ispvideo.c
drivers/media/platform/video-mux.c
drivers/media/platform/xilinx/xilinx-csi2rxss.c
drivers/media/platform/xilinx/xilinx-dma.c
drivers/media/test-drivers/vimc/vimc-streamer.c
drivers/staging/media/imx/imx-media-dev-common.c
drivers/staging/media/imx/imx-media-utils.c
drivers/staging/media/imx/imx7-media-csi.c
drivers/staging/media/omap4iss/iss.c
drivers/staging/media/omap4iss/iss_csi2.c
drivers/staging/media/omap4iss/iss_video.c
drivers/staging/media/tegra-video/vi.c
include/media/media-entity.h

index 02481a2513b9669f1e37b6c5ece0ec7a53decf6b..6eea6a3b64411bdb86ca657aaf8180c7d55bb25a 100644 (file)
@@ -186,8 +186,7 @@ is required and the graph structure can be freed normally.
 
 Helper functions can be used to find a link between two given pads, or a pad
 connected to another pad through an enabled link
-:c:func:`media_entity_find_link()` and
-:c:func:`media_entity_remote_pad()`.
+:c:func:`media_entity_find_link()` and :c:func:`media_pad_remote_pad_first()`.
 
 Use count and power handling
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
index 31bac06d46b5f7122e34fbe8613e89f28ff7a93c..d75eb3d8be5abb36f0e85bb51a66f0dad1483428 100644 (file)
@@ -417,7 +417,7 @@ int adv748x_write_block(struct adv748x_state *state, int client_page,
 
 static inline struct v4l2_subdev *adv748x_get_remote_sd(struct media_pad *pad)
 {
-       pad = media_entity_remote_pad(pad);
+       pad = media_pad_remote_pad_first(pad);
        if (!pad)
                return NULL;
 
index 65472438444bbc14c4237638a3550ee9cfa48b38..93a980c4e8990403c35345d7e155910cf3752b64 100644 (file)
@@ -1285,7 +1285,7 @@ static int tvp5150_disable_all_input_links(struct tvp5150 *decoder)
        int err;
 
        for (i = 0; i < TVP5150_NUM_PADS - 1; i++) {
-               connector_pad = media_entity_remote_pad(&decoder->pads[i]);
+               connector_pad = media_pad_remote_pad_first(&decoder->pads[i]);
                if (!connector_pad)
                        continue;
 
index cebb905260d3f02ff7e33dc1867e6a84f4c7e2c6..66ba0629c4ce4fa7fabb996e5938dea7537eed00 100644 (file)
@@ -901,7 +901,7 @@ media_entity_find_link(struct media_pad *source, struct media_pad *sink)
 }
 EXPORT_SYMBOL_GPL(media_entity_find_link);
 
-struct media_pad *media_entity_remote_pad(const struct media_pad *pad)
+struct media_pad *media_pad_remote_pad_first(const struct media_pad *pad)
 {
        struct media_link *link;
 
@@ -919,7 +919,7 @@ struct media_pad *media_entity_remote_pad(const struct media_pad *pad)
        return NULL;
 
 }
-EXPORT_SYMBOL_GPL(media_entity_remote_pad);
+EXPORT_SYMBOL_GPL(media_pad_remote_pad_first);
 
 static void media_interface_init(struct media_device *mdev,
                                 struct media_interface *intf,
index dbdbdb648a0d32620303fb5eeea0b89958a232c2..a3fe547b7fcec1eeb49182372a26a07e7b8961ca 100644 (file)
@@ -1323,7 +1323,7 @@ static int cio2_video_link_validate(struct media_link *link)
        struct v4l2_subdev_format source_fmt;
        int ret;
 
-       if (!media_entity_remote_pad(entity->pads)) {
+       if (!media_pad_remote_pad_first(entity->pads)) {
                dev_info(dev, "video node %s pad not connected\n", vd->name);
                return -ENOTCONN;
        }
index 80628801cf09fc25298b9f721ccd671d89494da1..88f188e0f7501be50bcd372f3cc5a9c1693bc504 100644 (file)
@@ -245,7 +245,7 @@ static int csid_set_stream(struct v4l2_subdev *sd, int enable)
                }
 
                if (!csid->testgen.enabled &&
-                   !media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK]))
+                   !media_pad_remote_pad_first(&csid->pads[MSM_CSID_PAD_SINK]))
                        return -ENOLINK;
        }
 
@@ -518,7 +518,7 @@ static int csid_set_test_pattern(struct csid_device *csid, s32 value)
        struct csid_testgen_config *tg = &csid->testgen;
 
        /* If CSID is linked to CSIPHY, do not allow to enable test generator */
-       if (value && media_entity_remote_pad(&csid->pads[MSM_CSID_PAD_SINK]))
+       if (value && media_pad_remote_pad_first(&csid->pads[MSM_CSID_PAD_SINK]))
                return -EBUSY;
 
        tg->enabled = !!value;
@@ -729,7 +729,7 @@ static int csid_link_setup(struct media_entity *entity,
                           const struct media_pad *remote, u32 flags)
 {
        if (flags & MEDIA_LNK_FL_ENABLED)
-               if (media_entity_remote_pad(local))
+               if (media_pad_remote_pad_first(local))
                        return -EBUSY;
 
        if ((local->flags & MEDIA_PAD_FL_SINK) &&
index 75fcfc6274000c65ef2c767059989b2505824bc6..3f726a7237f5663001954c29f9680f56febcc76c 100644 (file)
@@ -693,7 +693,7 @@ static int csiphy_link_setup(struct media_entity *entity,
                struct csiphy_device *csiphy;
                struct csid_device *csid;
 
-               if (media_entity_remote_pad(local))
+               if (media_pad_remote_pad_first(local))
                        return -EBUSY;
 
                sd = media_entity_to_v4l2_subdev(entity);
index 91e6a2b9ac5041789fe75f86cd5ac350a7b73a08..b713f5b86aba696229d531953d38aa21d00bab1e 100644 (file)
@@ -812,7 +812,7 @@ static int ispif_set_stream(struct v4l2_subdev *sd, int enable)
        int ret;
 
        if (enable) {
-               if (!media_entity_remote_pad(&line->pads[MSM_ISPIF_PAD_SINK]))
+               if (!media_pad_remote_pad_first(&line->pads[MSM_ISPIF_PAD_SINK]))
                        return -ENOLINK;
 
                /* Config */
@@ -1301,7 +1301,7 @@ static int ispif_link_setup(struct media_entity *entity,
                            const struct media_pad *remote, u32 flags)
 {
        if (flags & MEDIA_LNK_FL_ENABLED) {
-               if (media_entity_remote_pad(local))
+               if (media_pad_remote_pad_first(local))
                        return -EBUSY;
 
                if (local->flags & MEDIA_PAD_FL_SINK) {
index 76e28b8325685767c6987fb95838b764bbbd8063..a26e4a5d87b6bb7d03340994cbcac38ec5c68c21 100644 (file)
@@ -1436,7 +1436,7 @@ static int vfe_link_setup(struct media_entity *entity,
                          const struct media_pad *remote, u32 flags)
 {
        if (flags & MEDIA_LNK_FL_ENABLED)
-               if (media_entity_remote_pad(local))
+               if (media_pad_remote_pad_first(local))
                        return -EBUSY;
 
        return 0;
index 307bb1dc45898387856fd354c93040c9f7776cfc..290df04c4d02c399860737bdb1559b375777c768 100644 (file)
@@ -328,7 +328,7 @@ static struct v4l2_subdev *video_remote_subdev(struct camss_video *video,
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(&video->pad);
+       remote = media_pad_remote_pad_first(&video->pad);
 
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
@@ -507,7 +507,7 @@ static int video_start_streaming(struct vb2_queue *q, unsigned int count)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
@@ -543,7 +543,7 @@ static void video_stop_streaming(struct vb2_queue *q)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
index 932968e5f1e5271b732df44b08a797de5b50946f..1118c40886d5277b443b074cc6a34ed4e97cf9d0 100644 (file)
@@ -937,7 +937,7 @@ struct media_entity *camss_find_sensor(struct media_entity *entity)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        return NULL;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        return NULL;
 
index 4b7a9743554af6c3ead1ddf66188467ddb61395f..968a74234e929cdcfea2132db0ef1391b092cf03 100644 (file)
@@ -845,7 +845,7 @@ static int rvin_csi2_link_notify(struct media_link *link, u32 flags,
                                continue;
 
                        /* Get remote CSI-2, if any. */
-                       csi_pad = media_entity_remote_pad(
+                       csi_pad = media_pad_remote_pad_first(
                                        &group->vin[i]->vdev.entity.pads[0]);
                        if (!csi_pad)
                                continue;
index fea8f00a915264d9d966faa891f490df8fc6c5ff..174aa6176f540c27f7a0161ab6b68d94664ccdc6 100644 (file)
@@ -1313,7 +1313,7 @@ static int rcsi2_link_setup(struct media_entity *entity,
        channel = id % 4;
 
        if (flags & MEDIA_LNK_FL_ENABLED) {
-               if (media_entity_remote_pad(local)) {
+               if (media_pad_remote_pad_first(local)) {
                        dev_dbg(priv->dev,
                                "Each VC can only be routed to one output channel\n");
                        return -EINVAL;
index 6644b498929d16fc2ed90209d800cad8162f4f11..8d37fbdc266a0c6a023a15cd094a4aea950278ca 100644 (file)
@@ -1258,7 +1258,7 @@ static int rvin_set_stream(struct rvin_dev *vin, int on)
                return ret == -ENOIOCTLCMD ? 0 : ret;
        }
 
-       pad = media_entity_remote_pad(&vin->pad);
+       pad = media_pad_remote_pad_first(&vin->pad);
        if (!pad)
                return -EPIPE;
 
index 2e2aa9d746eed9c855a39676f0cd961afe7ae8dd..576059f9bbe30adb4de9961c62d2e77c4475c1a6 100644 (file)
@@ -1032,7 +1032,7 @@ static void rvin_notify(struct v4l2_subdev *sd,
                if (!vin)
                        continue;
 
-               pad = media_entity_remote_pad(&vin->pad);
+               pad = media_pad_remote_pad_first(&vin->pad);
                if (!pad)
                        continue;
 
index a116a3362f9e6255a1e13c68a424c72b34a11939..4c3bd2b1ca287896a7499add4cf8dae1665737f8 100644 (file)
@@ -516,8 +516,8 @@ int vsp1_entity_link_setup(struct media_entity *entity,
  * higher than one for the data pipelines, except for the links to the HGO and
  * HGT that can be enabled in addition to a regular data link. When traversing
  * outgoing links this function ignores HGO and HGT entities and should thus be
- * used in place of the generic media_entity_remote_pad() function to traverse
- * data pipelines.
+ * used in place of the generic media_pad_remote_pad_first() function to
+ * traverse data pipelines.
  *
  * Return a pointer to the pad at the remote end of the first found enabled
  * link, or NULL if no enabled link has been found.
index 51219b1b6ea92b41cea66f0d11c0638a45a73ed7..e8e0ee5f2277059c3b677449d6f21c00c2d35da4 100644 (file)
@@ -50,7 +50,7 @@ vsp1_video_remote_subdev(struct media_pad *local, u32 *pad)
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(local);
+       remote = media_pad_remote_pad_first(local);
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
 
index 187d78075acbcfe026aef336d5d7b754be10997f..a97c145bad981ac38208817aec8782bdfa5dbdcf 100644 (file)
@@ -200,7 +200,7 @@ static struct v4l2_subdev *rkisp1_get_remote_sensor(struct v4l2_subdev *sd)
        struct media_entity *sensor_me;
 
        local = &sd->entity.pads[RKISP1_ISP_PAD_SINK_VIDEO];
-       remote = media_entity_remote_pad(local);
+       remote = media_pad_remote_pad_first(local);
        if (!remote)
                return NULL;
 
index 26ee2388edfd4c54ce3dc5cb4c76db280fbf458d..e41333535eace80f115c475a380148415847d275 100644 (file)
@@ -21,7 +21,7 @@ struct v4l2_subdev *fimc_find_remote_sensor(struct media_entity *entity)
 
        while (pad->flags & MEDIA_PAD_FL_SINK) {
                /* source pad */
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
index 7ff4024003f4aa82f4c4ab328ad83f3f685a08c5..03638c8f772d0e784c104030ad8f0e6fbb0e7338 100644 (file)
@@ -737,7 +737,7 @@ static struct media_entity *fimc_pipeline_get_head(struct media_entity *me)
        struct media_pad *pad = &me->pads[0];
 
        while (!(pad->flags & MEDIA_PAD_FL_SOURCE)) {
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad)
                        break;
                me = pad->entity;
@@ -810,7 +810,7 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx,
                                        return ret;
                        }
 
-                       pad = media_entity_remote_pad(&me->pads[sfmt.pad]);
+                       pad = media_pad_remote_pad_first(&me->pads[sfmt.pad]);
                        if (!pad)
                                return -EINVAL;
                        me = pad->entity;
@@ -1115,7 +1115,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc)
 
                        if (p->flags & MEDIA_PAD_FL_SINK) {
                                sink_pad = p;
-                               src_pad = media_entity_remote_pad(sink_pad);
+                               src_pad = media_pad_remote_pad_first(sink_pad);
                                if (src_pad)
                                        break;
                        }
index 83688a7982f7034751b8708b44664073e449a07f..8f12240b0eb7ab8b01bc7d3b2c25608f5d488512 100644 (file)
@@ -465,7 +465,7 @@ static int isp_video_pipeline_validate(struct fimc_isp *isp)
                        return -EPIPE;
 
                /* Retrieve format at the source pad */
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
index 1a396b7cd9a9cf476ade1cb24a372acfa72c384a..41b0a4a5929a76323708c23df522f98f0a63deb1 100644 (file)
@@ -789,7 +789,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc)
                                return -EPIPE;
                }
                /* Retrieve format at the source pad */
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
index 544b54e428c9eca9b62110ff9677689d7b1bb223..52b43ea040302ee555ac6eed6cdd2235e8a53455 100644 (file)
@@ -81,7 +81,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p,
                        struct media_pad *spad = &me->pads[i];
                        if (!(spad->flags & MEDIA_PAD_FL_SINK))
                                continue;
-                       pad = media_entity_remote_pad(spad);
+                       pad = media_pad_remote_pad_first(spad);
                        if (pad)
                                break;
                }
index 140854ab4dd8c17746215865a73ecba0efc1078a..c2d8f1e425d879f9a1520f15f78be9f95089d938 100644 (file)
@@ -811,7 +811,7 @@ static int camif_pipeline_validate(struct camif_dev *camif)
        int ret;
 
        /* Retrieve format at the sensor subdev source pad */
-       pad = media_entity_remote_pad(&camif->pads[0]);
+       pad = media_pad_remote_pad_first(&camif->pads[0]);
        if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                return -EPIPE;
 
index 9b14a113083f3c09e2156583debee28b0c49bb04..2ca95ab2b0fe4a208bcdb571a3ffe1599a33d74c 100644 (file)
@@ -611,7 +611,7 @@ static struct media_entity *dcmi_find_source(struct stm32_dcmi *dcmi)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
@@ -681,7 +681,7 @@ static int dcmi_pipeline_s_fmt(struct stm32_dcmi *dcmi,
                }
 
                /* Walk to next entity */
-               sink_pad = media_entity_remote_pad(src_pad);
+               sink_pad = media_pad_remote_pad_first(src_pad);
                if (!sink_pad || !is_media_entity_v4l2_subdev(sink_pad->entity))
                        break;
 
@@ -705,7 +705,7 @@ static int dcmi_pipeline_s_stream(struct stm32_dcmi *dcmi, int state)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
index 682c26536034c301878d4969a1cc53604c5cb1ba..1d46e113d01d5095c1910e77e5c78c5f14295b9a 100644 (file)
@@ -77,7 +77,7 @@ sun6i_video_remote_subdev(struct sun6i_video *video, u32 *pad)
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(&video->pad);
+       remote = media_pad_remote_pad_first(&video->pad);
 
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
@@ -560,7 +560,7 @@ static int sun6i_video_link_validate(struct media_link *link)
 
        video->mbus_code = 0;
 
-       if (!media_entity_remote_pad(link->sink->entity->pads)) {
+       if (!media_pad_remote_pad_first(link->sink->entity->pads)) {
                dev_info(video->csi->dev,
                         "video node %s pad not connected\n", vdev->name);
                return -ENOLINK;
index a0880f0091f7b530d4a0e5d0a41732daafc23bab..e136d70b40487c4d251a8e80ab627469bf617bac 100644 (file)
@@ -592,7 +592,7 @@ int cal_camerarx_get_remote_frame_desc(struct cal_camerarx *phy,
        if (!phy->source)
                return -EPIPE;
 
-       pad = media_entity_remote_pad(&phy->pads[CAL_CAMERARX_PAD_SINK]);
+       pad = media_pad_remote_pad_first(&phy->pads[CAL_CAMERARX_PAD_SINK]);
        if (!pad)
                return -EPIPE;
 
index 07ae1a34e6b0bbbed5ec90355e79a517d574594f..776da0cfcdbe284de54cc9be204d06ee8c489b28 100644 (file)
@@ -685,7 +685,7 @@ static int cal_video_check_format(struct cal_ctx *ctx)
        const struct v4l2_mbus_framefmt *format;
        struct media_pad *remote_pad;
 
-       remote_pad = media_entity_remote_pad(&ctx->pad);
+       remote_pad = media_pad_remote_pad_first(&ctx->pad);
        if (!remote_pad)
                return -ENODEV;
 
index 4c937f3f323e1a9e034c9ef7faed62e7eb608bca..d251736eb4202d2c4c7bd499a15f99cca538302c 100644 (file)
@@ -700,7 +700,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe,
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
@@ -797,7 +797,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
@@ -942,7 +942,7 @@ static int isp_pipeline_is_last(struct media_entity *me)
        pipe = to_isp_pipeline(me);
        if (pipe->stream_state == ISP_PIPELINE_STREAM_STOPPED)
                return 0;
-       pad = media_entity_remote_pad(&pipe->output->pad);
+       pad = media_pad_remote_pad_first(&pipe->output->pad);
        return pad->entity == me;
 }
 
index 108b5e9f82cb0f43d637aa6f8f48d070a0f243e6..11afb8aec29214d7fac2a9a26105acb9b2ce4ae2 100644 (file)
@@ -1133,7 +1133,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc)
        ccdc->bt656 = false;
        ccdc->fields = 0;
 
-       pad = media_entity_remote_pad(&ccdc->pads[CCDC_PAD_SINK]);
+       pad = media_pad_remote_pad_first(&ccdc->pads[CCDC_PAD_SINK]);
        sensor = media_entity_to_v4l2_subdev(pad->entity);
        if (ccdc->input == CCDC_INPUT_PARALLEL) {
                struct v4l2_subdev *sd =
index acb58b6ddba188745097a43e8f88f134ec0926e7..fc90ff88464fd368400a15cd761e8f9936c45f12 100644 (file)
@@ -357,7 +357,7 @@ static int ccp2_if_configure(struct isp_ccp2_device *ccp2)
 
        ccp2_pwr_cfg(ccp2);
 
-       pad = media_entity_remote_pad(&ccp2->pads[CCP2_PAD_SINK]);
+       pad = media_pad_remote_pad_first(&ccp2->pads[CCP2_PAD_SINK]);
        sensor = media_entity_to_v4l2_subdev(pad->entity);
        buscfg = v4l2_subdev_to_bus_cfg(pipe->external);
 
index 6302e0c94034f9e91439eb4eb179a0f74a6f2847..6870980a2fa9e01dfc2f9948dd9b546a8f213b07 100644 (file)
@@ -561,7 +561,7 @@ static int csi2_configure(struct isp_csi2_device *csi2)
        if (csi2->contexts[0].enabled || csi2->ctrl.if_enable)
                return -EBUSY;
 
-       pad = media_entity_remote_pad(&csi2->pads[CSI2_PAD_SINK]);
+       pad = media_pad_remote_pad_first(&csi2->pads[CSI2_PAD_SINK]);
        sensor = media_entity_to_v4l2_subdev(pad->entity);
        buscfg = v4l2_subdev_to_bus_cfg(pipe->external);
 
index 8811d6dd4ee747fc76374b9da7a832ba1bed7e94..d7059180e80ee66b9bdced93ad6d7b4550a92c99 100644 (file)
@@ -206,7 +206,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad)
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(&video->pad);
+       remote = media_pad_remote_pad_first(&video->pad);
 
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
@@ -981,7 +981,7 @@ static int isp_video_check_external_subdevs(struct isp_video *video,
                        continue;
 
                /* ISP entities have always sink pad == 0. Find source. */
-               source_pad = media_entity_remote_pad(&ents[i]->pads[0]);
+               source_pad = media_pad_remote_pad_first(&ents[i]->pads[0]);
                if (source_pad == NULL)
                        continue;
 
index b31e5913a4cda0e6714ce089cbafb30f7ba78299..71d97042a470ba0b93c3df4740aebc3257152a57 100644 (file)
@@ -118,7 +118,7 @@ static int video_mux_s_stream(struct v4l2_subdev *sd, int enable)
                return -EINVAL;
        }
 
-       pad = media_entity_remote_pad(&sd->entity.pads[vmux->active]);
+       pad = media_pad_remote_pad_first(&sd->entity.pads[vmux->active]);
        if (!pad) {
                dev_err(sd->dev, "Failed to find remote source pad\n");
                return -ENOLINK;
index 051c60cba1e05d117ddf7ca73ecc2e361f5c091f..cf8e892c47f0e86723c5518924a9ed0b50e9b0c0 100644 (file)
@@ -474,7 +474,7 @@ static struct v4l2_subdev *xcsi2rxss_get_remote_subdev(struct media_pad *local)
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(local);
+       remote = media_pad_remote_pad_first(local);
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
 
index 338c3661d8099dfd5ee5f993310f6fd55bb83ef1..2d1ef7a25c338ec42a79d24ce76323f9d26a39e9 100644 (file)
@@ -44,7 +44,7 @@ xvip_dma_remote_subdev(struct media_pad *local, u32 *pad)
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(local);
+       remote = media_pad_remote_pad_first(local);
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
 
@@ -107,7 +107,7 @@ static int xvip_pipeline_start_stop(struct xvip_pipeline *pipe, bool start)
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
index 65feb3c596db5bedd884bafd8195452def12a378..807551a5143b7892683270e4848ef30064f7d6fc 100644 (file)
@@ -30,7 +30,7 @@ static struct media_entity *vimc_get_source_entity(struct media_entity *ent)
        for (i = 0; i < ent->num_pads; i++) {
                if (ent->pads[i].flags & MEDIA_PAD_FL_SOURCE)
                        continue;
-               pad = media_entity_remote_pad(&ent->pads[i]);
+               pad = media_pad_remote_pad_first(&ent->pads[i]);
                return pad ? pad->entity : NULL;
        }
        return NULL;
index 80b69a9a752cba053b75c8d3534a868855db5bcd..e6d6ed3b11615532178231827f77b985723ee7f0 100644 (file)
@@ -235,7 +235,7 @@ static int imx_media_inherit_controls(struct imx_media_dev *imxmd,
                if (!(spad->flags & MEDIA_PAD_FL_SINK))
                        continue;
 
-               pad = media_entity_remote_pad(spad);
+               pad = media_pad_remote_pad_first(spad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        continue;
 
index 94bc866ca28cb3df1e7b755de4fbff487f0ca125..294c808b2ebe145f478be7fce100017c50a845e8 100644 (file)
@@ -698,7 +698,7 @@ imx_media_pipeline_pad(struct media_entity *start_entity, u32 grp_id,
                    (!upstream && !(spad->flags & MEDIA_PAD_FL_SOURCE)))
                        continue;
 
-               pad = media_entity_remote_pad(spad);
+               pad = media_pad_remote_pad_first(spad);
                if (!pad)
                        continue;
 
index 0066af8d111f53ca563c1c7ec0b4353686ef3c24..a0553c24cce4b4f8b1a804cf0f1560fc32d70870 100644 (file)
@@ -1963,7 +1963,7 @@ static int imx7_csi_pad_link_validate(struct v4l2_subdev *sd,
                        if (!(spad->flags & MEDIA_PAD_FL_SINK))
                                continue;
 
-                       pad = media_entity_remote_pad(spad);
+                       pad = media_pad_remote_pad_first(spad);
                        if (pad)
                                break;
                }
index 68588e9dab0b6dfe3c8b73a70c3d4b6b1bfaefcb..28aacda0f5a7db12f58253b4c930a575d80f1807 100644 (file)
@@ -395,7 +395,7 @@ static int iss_pipeline_disable(struct iss_pipeline *pipe,
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
@@ -464,7 +464,7 @@ static int iss_pipeline_enable(struct iss_pipeline *pipe,
                if (!(pad->flags & MEDIA_PAD_FL_SINK))
                        break;
 
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
 
@@ -553,7 +553,7 @@ static int iss_pipeline_is_last(struct media_entity *me)
        pipe = to_iss_pipeline(me);
        if (pipe->stream_state == ISS_PIPELINE_STREAM_STOPPED)
                return 0;
-       pad = media_entity_remote_pad(&pipe->output->pad);
+       pad = media_pad_remote_pad_first(&pipe->output->pad);
        return pad->entity == me;
 }
 
index 124ab2f44fbfb4040092b69de39d0dae499c4430..04ce0e7eb5578487afcb5f4e406134852d2495d9 100644 (file)
@@ -538,7 +538,7 @@ static int csi2_configure(struct iss_csi2_device *csi2)
        if (csi2->contexts[0].enabled || csi2->ctrl.if_enable)
                return -EBUSY;
 
-       pad = media_entity_remote_pad(&csi2->pads[CSI2_PAD_SINK]);
+       pad = media_pad_remote_pad_first(&csi2->pads[CSI2_PAD_SINK]);
        sensor = media_entity_to_v4l2_subdev(pad->entity);
        pdata = sensor->host_priv;
 
index d0da083deed538373d3e12161e9061b450297b4f..9512cd3314f2b28ad0760c79977f53c76bd0f22c 100644 (file)
@@ -190,7 +190,7 @@ iss_video_remote_subdev(struct iss_video *video, u32 *pad)
 {
        struct media_pad *remote;
 
-       remote = media_entity_remote_pad(&video->pad);
+       remote = media_pad_remote_pad_first(&video->pad);
 
        if (!remote || !is_media_entity_v4l2_subdev(remote->entity))
                return NULL;
index 8e184aa4c252fe557e00342f9bde43ef74e13804..9d46a36cc01400f3ebe3fec59a3ef507525a3fab 100644 (file)
@@ -157,7 +157,7 @@ tegra_channel_get_remote_csi_subdev(struct tegra_vi_channel *chan)
 {
        struct media_pad *pad;
 
-       pad = media_entity_remote_pad(&chan->pad);
+       pad = media_pad_remote_pad_first(&chan->pad);
        if (!pad)
                return NULL;
 
@@ -177,7 +177,7 @@ tegra_channel_get_remote_source_subdev(struct tegra_vi_channel *chan)
 
        pad = &subdev->entity.pads[0];
        while (!(pad->flags & MEDIA_PAD_FL_SOURCE)) {
-               pad = media_entity_remote_pad(pad);
+               pad = media_pad_remote_pad_first(pad);
                if (!pad || !is_media_entity_v4l2_subdev(pad->entity))
                        break;
                entity = pad->entity;
index 4efe2f88e6dcc3648e35d3953fd3e35340892c7a..5e272a0a9895c9a3f8d731e314bde32c8586a2b6 100644 (file)
@@ -848,7 +848,7 @@ struct media_link *media_entity_find_link(struct media_pad *source,
                struct media_pad *sink);
 
 /**
- * media_entity_remote_pad - Find the pad at the remote end of a link
+ * media_pad_remote_pad_first - Find the first pad at the remote end of a link
  * @pad: Pad at the local end of the link
  *
  * Search for a remote pad connected to the given pad by iterating over all
@@ -857,7 +857,7 @@ struct media_link *media_entity_find_link(struct media_pad *source,
  * Return: returns a pointer to the pad at the remote end of the first found
  * enabled link, or %NULL if no enabled link has been found.
  */
-struct media_pad *media_entity_remote_pad(const struct media_pad *pad);
+struct media_pad *media_pad_remote_pad_first(const struct media_pad *pad);
 
 /**
  * media_entity_is_streaming - Test if an entity is part of a streaming pipeline