From patchwork Tue Jan 22 08:24:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Hajda X-Patchwork-Id: 16392 X-Patchwork-Delegate: sylvester.nawrocki@gmail.com Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.72) (envelope-from ) id 1TxZAP-0006KO-4C; Tue, 22 Jan 2013 09:25:13 +0100 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.75/mailfrontend-3) with esmtp id 1TxZAN-0004Xh-Fv; Tue, 22 Jan 2013 09:25:12 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753047Ab3AVIZI (ORCPT + 1 other); Tue, 22 Jan 2013 03:25:08 -0500 Received: from mailout2.w1.samsung.com ([210.118.77.12]:53343 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752801Ab3AVIZH (ORCPT ); Tue, 22 Jan 2013 03:25:07 -0500 Received: from eucpsbgm2.samsung.com (unknown [203.254.199.245]) by mailout2.w1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0MH00025XQ1A1W00@mailout2.w1.samsung.com> for linux-media@vger.kernel.org; Tue, 22 Jan 2013 08:25:05 +0000 (GMT) X-AuditID: cbfec7f5-b7fd76d000007247-d9-50fe4ce1cd9e Received: from eusync3.samsung.com ( [203.254.199.213]) by eucpsbgm2.samsung.com (EUCPMTA) with SMTP id 39.00.29255.1EC4EF05; Tue, 22 Jan 2013 08:25:05 +0000 (GMT) Received: from AMDC1061.digital.local ([106.116.147.88]) by eusync3.samsung.com (Oracle Communications Messaging Server 7u4-23.01 (7.0.4.23.0) 64bit (built Aug 10 2011)) with ESMTPA id <0MH000D4KQ1N6Y60@eusync3.samsung.com> for linux-media@vger.kernel.org; Tue, 22 Jan 2013 08:25:05 +0000 (GMT) From: Andrzej Hajda To: linux-media@vger.kernel.org Cc: Sylwester Nawrocki , Andrzej Hajda , Kyungmin Park Subject: [PATCH RFC] media: Rename media_entity_remote_source to media_entity_remote_pad Date: Tue, 22 Jan 2013 09:24:55 +0100 Message-id: <1358843095-4839-1-git-send-email-a.hajda@samsung.com> X-Mailer: git-send-email 1.7.10.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNJMWRmVeSWpSXmKPExsVy+t/xq7oPff4FGPxcyWXRs2ErqwOjx+dN cgGMUVw2Kak5mWWpRfp2CVwZz3ZtYiuYlFex8bZuA+OJmC5GTg4JAROJ/T8vsEDYYhIX7q1n A7GFBJYySmy4rNXFyAVkr2OSmH5yHViCTUBT4u/mm2C2iIC8xJPeG2wgRcwCjYwSO7dvYgJJ CAtESVx8dpkRxGYRUJWYf7cZLM4r4CTRPeMj1DZFie5nE9gmMHIvYGRYxSiaWppcUJyUnmuk V5yYW1yal66XnJ+7iRHiwa87GJceszrEKMDBqMTDa/nob4AQa2JZcWXuIUYJDmYlEd7+f0Ah 3pTEyqrUovz4otKc1OJDjEwcnFINjAd5ks4K9hT5T7N1P5K4eZXu5fK2LN2G6P0q9nemhLHc 2Pcztnft/dV3Jf5qXXGcEtxRtC/V87iiVky1Uae5y45lVwq7ltdm7T32uuDp0gfrtrBsf9h9 9NmF+usRC6a/Uq7MN3E4rs8z4eqGeb8rwpkPPD7JdeJ1oL7KHB3LU1ybvVadfHfjbbISS3FG oqEWc1FxIgCcsWrPvgEAAA== Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2013.1.22.81815 X-PMX-Spam: Gauge=IIIIIIIII, Probability=9%, Report=' HTML_NO_HTTP 0.1, MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODY_SIZE_10000_PLUS 0, NO_URI_FOUND 0, __CP_MEDIA_BODY 0, __HAS_FROM 0, __HAS_HTML 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __MIME_TEXT_ONLY 0, __MULTIPLE_RCPTS_CC_X2 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0' Function media_entity_remote_source actually returns the remote pad to the given one, regardless if this is the source or the sink pad. Name media_entity_remote_pad is more adequate for this function. Signed-off-by: Andrzej Hajda Signed-off-by: Kyungmin Park Acked-by: Sakari Ailus Acked-by: Sylwester Nawrocki Acked-by: Laurent Pinchart --- Documentation/media-framework.txt | 2 +- drivers/media/media-entity.c | 13 ++++++------- drivers/media/platform/omap3isp/isp.c | 6 +++--- drivers/media/platform/omap3isp/ispccdc.c | 2 +- drivers/media/platform/omap3isp/ispccp2.c | 2 +- drivers/media/platform/omap3isp/ispcsi2.c | 2 +- drivers/media/platform/omap3isp/ispvideo.c | 6 +++--- drivers/media/platform/s3c-camif/camif-capture.c | 2 +- drivers/media/platform/s5p-fimc/fimc-capture.c | 8 ++++---- drivers/media/platform/s5p-fimc/fimc-lite.c | 4 ++-- drivers/media/platform/s5p-fimc/fimc-mdevice.c | 2 +- drivers/staging/media/davinci_vpfe/vpfe_video.c | 12 ++++++------ include/media/media-entity.h | 2 +- 13 files changed, 31 insertions(+), 32 deletions(-) diff --git a/Documentation/media-framework.txt b/Documentation/media-framework.txt index 8028754..e68744a 100644 --- a/Documentation/media-framework.txt +++ b/Documentation/media-framework.txt @@ -265,7 +265,7 @@ connected to another pad through an enabled link media_entity_find_link(struct media_pad *source, struct media_pad *sink); - media_entity_remote_source(struct media_pad *pad); + media_entity_remote_pad(struct media_pad *pad); Refer to the kerneldoc documentation for more information. diff --git a/drivers/media/media-entity.c b/drivers/media/media-entity.c index e1cd132..0438209 100644 --- a/drivers/media/media-entity.c +++ b/drivers/media/media-entity.c @@ -560,17 +560,16 @@ media_entity_find_link(struct media_pad *source, struct media_pad *sink) EXPORT_SYMBOL_GPL(media_entity_find_link); /** - * media_entity_remote_source - Find the source pad at the remote end of a link - * @pad: Sink pad at the local end of the link + * media_entity_remote_pad - Find the pad at the remote end of a link + * @pad: Pad at the local end of the link * - * Search for a remote source pad connected to the given sink pad by iterating - * over all links originating or terminating at that pad until an enabled link - * is found. + * Search for a remote pad connected to the given pad by iterating over all + * links originating or terminating at that pad until an enabled link is found. * * 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. */ -struct media_pad *media_entity_remote_source(struct media_pad *pad) +struct media_pad *media_entity_remote_pad(struct media_pad *pad) { unsigned int i; @@ -590,4 +589,4 @@ struct media_pad *media_entity_remote_source(struct media_pad *pad) return NULL; } -EXPORT_SYMBOL_GPL(media_entity_remote_source); +EXPORT_SYMBOL_GPL(media_entity_remote_pad); diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c index a9f6de5..5bb1698 100644 --- a/drivers/media/platform/omap3isp/isp.c +++ b/drivers/media/platform/omap3isp/isp.c @@ -757,7 +757,7 @@ static int isp_pipeline_enable(struct isp_pipeline *pipe, if (!(pad->flags & MEDIA_PAD_FL_SINK)) break; - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) break; @@ -847,7 +847,7 @@ static int isp_pipeline_disable(struct isp_pipeline *pipe) if (!(pad->flags & MEDIA_PAD_FL_SINK)) break; - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) break; @@ -963,7 +963,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_source(&pipe->output->pad); + pad = media_entity_remote_pad(&pipe->output->pad); return pad->entity == me; } diff --git a/drivers/media/platform/omap3isp/ispccdc.c b/drivers/media/platform/omap3isp/ispccdc.c index 60e60aa..907a205 100644 --- a/drivers/media/platform/omap3isp/ispccdc.c +++ b/drivers/media/platform/omap3isp/ispccdc.c @@ -1120,7 +1120,7 @@ static void ccdc_configure(struct isp_ccdc_device *ccdc) u32 syn_mode; u32 ccdc_pattern; - pad = media_entity_remote_source(&ccdc->pads[CCDC_PAD_SINK]); + pad = media_entity_remote_pad(&ccdc->pads[CCDC_PAD_SINK]); sensor = media_entity_to_v4l2_subdev(pad->entity); if (ccdc->input == CCDC_INPUT_PARALLEL) pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv) diff --git a/drivers/media/platform/omap3isp/ispccp2.c b/drivers/media/platform/omap3isp/ispccp2.c index 85f0de8..d134e60 100644 --- a/drivers/media/platform/omap3isp/ispccp2.c +++ b/drivers/media/platform/omap3isp/ispccp2.c @@ -360,7 +360,7 @@ static int ccp2_if_configure(struct isp_ccp2_device *ccp2) ccp2_pwr_cfg(ccp2); - pad = media_entity_remote_source(&ccp2->pads[CCP2_PAD_SINK]); + pad = media_entity_remote_pad(&ccp2->pads[CCP2_PAD_SINK]); sensor = media_entity_to_v4l2_subdev(pad->entity); pdata = sensor->host_priv; diff --git a/drivers/media/platform/omap3isp/ispcsi2.c b/drivers/media/platform/omap3isp/ispcsi2.c index 783f4b0..6db245d 100644 --- a/drivers/media/platform/omap3isp/ispcsi2.c +++ b/drivers/media/platform/omap3isp/ispcsi2.c @@ -573,7 +573,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_source(&csi2->pads[CSI2_PAD_SINK]); + pad = media_entity_remote_pad(&csi2->pads[CSI2_PAD_SINK]); sensor = media_entity_to_v4l2_subdev(pad->entity); pdata = sensor->host_priv; diff --git a/drivers/media/platform/omap3isp/ispvideo.c b/drivers/media/platform/omap3isp/ispvideo.c index e0d73a6..ed3e136 100644 --- a/drivers/media/platform/omap3isp/ispvideo.c +++ b/drivers/media/platform/omap3isp/ispvideo.c @@ -222,7 +222,7 @@ isp_video_remote_subdev(struct isp_video *video, u32 *pad) { struct media_pad *remote; - remote = media_entity_remote_source(&video->pad); + remote = media_entity_remote_pad(&video->pad); if (remote == NULL || media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV) @@ -317,7 +317,7 @@ static int isp_video_validate_pipeline(struct isp_pipeline *pipe) * entity can be found, and stop checking the pipeline if the * source entity isn't a subdev. */ - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL) return -EPIPE; @@ -904,7 +904,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_source(&ents[i]->pads[0]); + source_pad = media_entity_remote_pad(&ents[i]->pads[0]); if (source_pad == NULL) continue; diff --git a/drivers/media/platform/s3c-camif/camif-capture.c b/drivers/media/platform/s3c-camif/camif-capture.c index a55793c..4397722 100644 --- a/drivers/media/platform/s3c-camif/camif-capture.c +++ b/drivers/media/platform/s3c-camif/camif-capture.c @@ -845,7 +845,7 @@ static int camif_pipeline_validate(struct camif_dev *camif) int ret; /* Retrieve format at the sensor subdev source pad */ - pad = media_entity_remote_source(&camif->pads[0]); + pad = media_entity_remote_pad(&camif->pads[0]); if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) return -EPIPE; diff --git a/drivers/media/platform/s5p-fimc/fimc-capture.c b/drivers/media/platform/s5p-fimc/fimc-capture.c index 18a70e4..b5a0a2f 100644 --- a/drivers/media/platform/s5p-fimc/fimc-capture.c +++ b/drivers/media/platform/s5p-fimc/fimc-capture.c @@ -799,7 +799,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_source(pad); + pad = media_entity_remote_pad(pad); if (!pad) break; me = pad->entity; @@ -871,7 +871,7 @@ static int fimc_pipeline_try_format(struct fimc_ctx *ctx, return ret; } - pad = media_entity_remote_source(&me->pads[sfmt.pad]); + pad = media_entity_remote_pad(&me->pads[sfmt.pad]); if (!pad) return -EINVAL; me = pad->entity; @@ -1158,7 +1158,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) int ret; /* Start with the video capture node pad */ - pad = media_entity_remote_source(&vid_cap->vd_pad); + pad = media_entity_remote_pad(&vid_cap->vd_pad); if (pad == NULL) return -EPIPE; /* FIMC.{N} subdevice */ @@ -1183,7 +1183,7 @@ static int fimc_pipeline_validate(struct fimc_dev *fimc) return -EPIPE; } /* Retrieve format at the source pad */ - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) break; diff --git a/drivers/media/platform/s5p-fimc/fimc-lite.c b/drivers/media/platform/s5p-fimc/fimc-lite.c index ef31c39..a48abb2 100644 --- a/drivers/media/platform/s5p-fimc/fimc-lite.c +++ b/drivers/media/platform/s5p-fimc/fimc-lite.c @@ -774,7 +774,7 @@ static int fimc_pipeline_validate(struct fimc_lite *fimc) return -EPIPE; } /* Retrieve format at the source pad */ - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) break; @@ -981,7 +981,7 @@ static struct v4l2_subdev *__find_remote_sensor(struct media_entity *me) while (pad->flags & MEDIA_PAD_FL_SINK) { /* source pad */ - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) break; diff --git a/drivers/media/platform/s5p-fimc/fimc-mdevice.c b/drivers/media/platform/s5p-fimc/fimc-mdevice.c index 62f3a71..8399d31 100644 --- a/drivers/media/platform/s5p-fimc/fimc-mdevice.c +++ b/drivers/media/platform/s5p-fimc/fimc-mdevice.c @@ -54,7 +54,7 @@ static void fimc_pipeline_prepare(struct fimc_pipeline *p, break; /* source pad */ - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV) break; diff --git a/drivers/staging/media/davinci_vpfe/vpfe_video.c b/drivers/staging/media/davinci_vpfe/vpfe_video.c index 99ccbeb..de52978 100644 --- a/drivers/staging/media/davinci_vpfe/vpfe_video.c +++ b/drivers/staging/media/davinci_vpfe/vpfe_video.c @@ -39,7 +39,7 @@ static struct media_entity *vpfe_get_input_entity struct vpfe_device *vpfe_dev = video->vpfe_dev; struct media_pad *remote; - remote = media_entity_remote_source(&vpfe_dev->vpfe_isif.pads[0]); + remote = media_entity_remote_pad(&vpfe_dev->vpfe_isif.pads[0]); if (remote == NULL) { pr_err("Invalid media connection to isif/ccdc\n"); return NULL; @@ -56,7 +56,7 @@ static int vpfe_update_current_ext_subdev(struct vpfe_video_device *video) struct media_pad *remote; int i; - remote = media_entity_remote_source(&vpfe_dev->vpfe_isif.pads[0]); + remote = media_entity_remote_pad(&vpfe_dev->vpfe_isif.pads[0]); if (remote == NULL) { pr_err("Invalid media connection to isif/ccdc\n"); return -EINVAL; @@ -89,7 +89,7 @@ static int vpfe_update_current_ext_subdev(struct vpfe_video_device *video) static struct v4l2_subdev * vpfe_video_remote_subdev(struct vpfe_video_device *video, u32 *pad) { - struct media_pad *remote = media_entity_remote_source(&video->pad); + struct media_pad *remote = media_entity_remote_pad(&video->pad); if (remote == NULL || remote->entity->type != MEDIA_ENT_T_V4L2_SUBDEV) return NULL; @@ -114,7 +114,7 @@ __vpfe_video_get_format(struct vpfe_video_device *video, return -EINVAL; fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; - remote = media_entity_remote_source(&video->pad); + remote = media_entity_remote_pad(&video->pad); fmt.pad = remote->index; ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt); @@ -245,7 +245,7 @@ static int vpfe_video_validate_pipeline(struct vpfe_pipeline *pipe) return -EPIPE; /* Retrieve the source format */ - pad = media_entity_remote_source(pad); + pad = media_entity_remote_pad(pad); if (pad == NULL || pad->entity->type != MEDIA_ENT_T_V4L2_SUBDEV) break; @@ -667,7 +667,7 @@ static int vpfe_enum_fmt(struct file *file, void *priv, return -EINVAL; } /* get the remote pad */ - remote = media_entity_remote_source(&video->pad); + remote = media_entity_remote_pad(&video->pad); if (remote == NULL) { v4l2_err(&vpfe_dev->v4l2_dev, "invalid remote pad for video node\n"); diff --git a/include/media/media-entity.h b/include/media/media-entity.h index 0c16f51..4eefedc 100644 --- a/include/media/media-entity.h +++ b/include/media/media-entity.h @@ -132,7 +132,7 @@ int __media_entity_setup_link(struct media_link *link, u32 flags); int media_entity_setup_link(struct media_link *link, u32 flags); struct media_link *media_entity_find_link(struct media_pad *source, struct media_pad *sink); -struct media_pad *media_entity_remote_source(struct media_pad *pad); +struct media_pad *media_entity_remote_pad(struct media_pad *pad); struct media_entity *media_entity_get(struct media_entity *entity); void media_entity_put(struct media_entity *entity);