Commit 1bddf1b3ac021feb9dafcc2c6ef7018453e22589

Authored by Andrzej Hajda
Committed by Mauro Carvalho Chehab
1 parent d716ef46fb

[media] media: Rename media_entity_remote_source to media_entity_remote_pad

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 <a.hajda@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Acked-by: Sakari Ailus <sakari.ailus@iki.fi>
Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

Showing 13 changed files with 30 additions and 31 deletions Side-by-side Diff

Documentation/media-framework.txt
... ... @@ -265,7 +265,7 @@
265 265 media_entity_find_link(struct media_pad *source,
266 266 struct media_pad *sink);
267 267  
268   - media_entity_remote_source(struct media_pad *pad);
  268 + media_entity_remote_pad(struct media_pad *pad);
269 269  
270 270 Refer to the kerneldoc documentation for more information.
271 271  
drivers/media/media-entity.c
... ... @@ -560,17 +560,16 @@
560 560 EXPORT_SYMBOL_GPL(media_entity_find_link);
561 561  
562 562 /**
563   - * media_entity_remote_source - Find the source pad at the remote end of a link
564   - * @pad: Sink pad at the local end of the link
  563 + * media_entity_remote_pad - Find the pad at the remote end of a link
  564 + * @pad: Pad at the local end of the link
565 565 *
566   - * Search for a remote source pad connected to the given sink pad by iterating
567   - * over all links originating or terminating at that pad until an enabled link
568   - * is found.
  566 + * Search for a remote pad connected to the given pad by iterating over all
  567 + * links originating or terminating at that pad until an enabled link is found.
569 568 *
570 569 * Return a pointer to the pad at the remote end of the first found enabled
571 570 * link, or NULL if no enabled link has been found.
572 571 */
573   -struct media_pad *media_entity_remote_source(struct media_pad *pad)
  572 +struct media_pad *media_entity_remote_pad(struct media_pad *pad)
574 573 {
575 574 unsigned int i;
576 575  
... ... @@ -590,5 +589,5 @@
590 589 return NULL;
591 590  
592 591 }
593   -EXPORT_SYMBOL_GPL(media_entity_remote_source);
  592 +EXPORT_SYMBOL_GPL(media_entity_remote_pad);
drivers/media/platform/exynos4-is/fimc-capture.c
... ... @@ -773,7 +773,7 @@
773 773 struct media_pad *pad = &me->pads[0];
774 774  
775 775 while (!(pad->flags & MEDIA_PAD_FL_SOURCE)) {
776   - pad = media_entity_remote_source(pad);
  776 + pad = media_entity_remote_pad(pad);
777 777 if (!pad)
778 778 break;
779 779 me = pad->entity;
... ... @@ -845,7 +845,7 @@
845 845 return ret;
846 846 }
847 847  
848   - pad = media_entity_remote_source(&me->pads[sfmt.pad]);
  848 + pad = media_entity_remote_pad(&me->pads[sfmt.pad]);
849 849 if (!pad)
850 850 return -EINVAL;
851 851 me = pad->entity;
... ... @@ -1146,7 +1146,7 @@
1146 1146  
1147 1147 if (p->flags & MEDIA_PAD_FL_SINK) {
1148 1148 sink_pad = p;
1149   - src_pad = media_entity_remote_source(sink_pad);
  1149 + src_pad = media_entity_remote_pad(sink_pad);
1150 1150 if (src_pad)
1151 1151 break;
1152 1152 }
drivers/media/platform/exynos4-is/fimc-lite.c
... ... @@ -139,7 +139,7 @@
139 139  
140 140 while (pad->flags & MEDIA_PAD_FL_SINK) {
141 141 /* source pad */
142   - pad = media_entity_remote_source(pad);
  142 + pad = media_entity_remote_pad(pad);
143 143 if (pad == NULL ||
144 144 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
145 145 break;
... ... @@ -786,7 +786,7 @@
786 786 return -EPIPE;
787 787 }
788 788 /* Retrieve format at the source pad */
789   - pad = media_entity_remote_source(pad);
  789 + pad = media_entity_remote_pad(pad);
790 790 if (pad == NULL ||
791 791 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
792 792 break;
drivers/media/platform/exynos4-is/media-dev.c
... ... @@ -62,7 +62,7 @@
62 62 struct media_pad *spad = &me->pads[i];
63 63 if (!(spad->flags & MEDIA_PAD_FL_SINK))
64 64 continue;
65   - pad = media_entity_remote_source(spad);
  65 + pad = media_entity_remote_pad(spad);
66 66 if (pad)
67 67 break;
68 68 }
drivers/media/platform/omap3isp/isp.c
... ... @@ -877,7 +877,7 @@
877 877 if (!(pad->flags & MEDIA_PAD_FL_SINK))
878 878 break;
879 879  
880   - pad = media_entity_remote_source(pad);
  880 + pad = media_entity_remote_pad(pad);
881 881 if (pad == NULL ||
882 882 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
883 883 break;
... ... @@ -967,7 +967,7 @@
967 967 if (!(pad->flags & MEDIA_PAD_FL_SINK))
968 968 break;
969 969  
970   - pad = media_entity_remote_source(pad);
  970 + pad = media_entity_remote_pad(pad);
971 971 if (pad == NULL ||
972 972 media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
973 973 break;
... ... @@ -1083,7 +1083,7 @@
1083 1083 pipe = to_isp_pipeline(me);
1084 1084 if (pipe->stream_state == ISP_PIPELINE_STREAM_STOPPED)
1085 1085 return 0;
1086   - pad = media_entity_remote_source(&pipe->output->pad);
  1086 + pad = media_entity_remote_pad(&pipe->output->pad);
1087 1087 return pad->entity == me;
1088 1088 }
1089 1089  
drivers/media/platform/omap3isp/ispccdc.c
... ... @@ -1120,7 +1120,7 @@
1120 1120 u32 syn_mode;
1121 1121 u32 ccdc_pattern;
1122 1122  
1123   - pad = media_entity_remote_source(&ccdc->pads[CCDC_PAD_SINK]);
  1123 + pad = media_entity_remote_pad(&ccdc->pads[CCDC_PAD_SINK]);
1124 1124 sensor = media_entity_to_v4l2_subdev(pad->entity);
1125 1125 if (ccdc->input == CCDC_INPUT_PARALLEL)
1126 1126 pdata = &((struct isp_v4l2_subdevs_group *)sensor->host_priv)
drivers/media/platform/omap3isp/ispccp2.c
... ... @@ -360,7 +360,7 @@
360 360  
361 361 ccp2_pwr_cfg(ccp2);
362 362  
363   - pad = media_entity_remote_source(&ccp2->pads[CCP2_PAD_SINK]);
  363 + pad = media_entity_remote_pad(&ccp2->pads[CCP2_PAD_SINK]);
364 364 sensor = media_entity_to_v4l2_subdev(pad->entity);
365 365 pdata = sensor->host_priv;
366 366  
drivers/media/platform/omap3isp/ispcsi2.c
... ... @@ -573,7 +573,7 @@
573 573 if (csi2->contexts[0].enabled || csi2->ctrl.if_enable)
574 574 return -EBUSY;
575 575  
576   - pad = media_entity_remote_source(&csi2->pads[CSI2_PAD_SINK]);
  576 + pad = media_entity_remote_pad(&csi2->pads[CSI2_PAD_SINK]);
577 577 sensor = media_entity_to_v4l2_subdev(pad->entity);
578 578 pdata = sensor->host_priv;
579 579  
drivers/media/platform/omap3isp/ispvideo.c
... ... @@ -219,7 +219,7 @@
219 219 {
220 220 struct media_pad *remote;
221 221  
222   - remote = media_entity_remote_source(&video->pad);
  222 + remote = media_entity_remote_pad(&video->pad);
223 223  
224 224 if (remote == NULL ||
225 225 media_entity_type(remote->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
... ... @@ -314,7 +314,7 @@
314 314 * entity can be found, and stop checking the pipeline if the
315 315 * source entity isn't a subdev.
316 316 */
317   - pad = media_entity_remote_source(pad);
  317 + pad = media_entity_remote_pad(pad);
318 318 if (pad == NULL)
319 319 return -EPIPE;
320 320  
... ... @@ -901,7 +901,7 @@
901 901 continue;
902 902  
903 903 /* ISP entities have always sink pad == 0. Find source. */
904   - source_pad = media_entity_remote_source(&ents[i]->pads[0]);
  904 + source_pad = media_entity_remote_pad(&ents[i]->pads[0]);
905 905 if (source_pad == NULL)
906 906 continue;
907 907  
drivers/media/platform/s3c-camif/camif-capture.c
... ... @@ -845,7 +845,7 @@
845 845 int ret;
846 846  
847 847 /* Retrieve format at the sensor subdev source pad */
848   - pad = media_entity_remote_source(&camif->pads[0]);
  848 + pad = media_entity_remote_pad(&camif->pads[0]);
849 849 if (!pad || media_entity_type(pad->entity) != MEDIA_ENT_T_V4L2_SUBDEV)
850 850 return -EPIPE;
851 851  
drivers/staging/media/davinci_vpfe/vpfe_video.c
... ... @@ -39,7 +39,7 @@
39 39 struct vpfe_device *vpfe_dev = video->vpfe_dev;
40 40 struct media_pad *remote;
41 41  
42   - remote = media_entity_remote_source(&vpfe_dev->vpfe_isif.pads[0]);
  42 + remote = media_entity_remote_pad(&vpfe_dev->vpfe_isif.pads[0]);
43 43 if (remote == NULL) {
44 44 pr_err("Invalid media connection to isif/ccdc\n");
45 45 return NULL;
... ... @@ -56,7 +56,7 @@
56 56 struct media_pad *remote;
57 57 int i;
58 58  
59   - remote = media_entity_remote_source(&vpfe_dev->vpfe_isif.pads[0]);
  59 + remote = media_entity_remote_pad(&vpfe_dev->vpfe_isif.pads[0]);
60 60 if (remote == NULL) {
61 61 pr_err("Invalid media connection to isif/ccdc\n");
62 62 return -EINVAL;
... ... @@ -89,7 +89,7 @@
89 89 static struct v4l2_subdev *
90 90 vpfe_video_remote_subdev(struct vpfe_video_device *video, u32 *pad)
91 91 {
92   - struct media_pad *remote = media_entity_remote_source(&video->pad);
  92 + struct media_pad *remote = media_entity_remote_pad(&video->pad);
93 93  
94 94 if (remote == NULL || remote->entity->type != MEDIA_ENT_T_V4L2_SUBDEV)
95 95 return NULL;
... ... @@ -114,7 +114,7 @@
114 114 return -EINVAL;
115 115  
116 116 fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE;
117   - remote = media_entity_remote_source(&video->pad);
  117 + remote = media_entity_remote_pad(&video->pad);
118 118 fmt.pad = remote->index;
119 119  
120 120 ret = v4l2_subdev_call(subdev, pad, get_fmt, NULL, &fmt);
... ... @@ -245,7 +245,7 @@
245 245 return -EPIPE;
246 246  
247 247 /* Retrieve the source format */
248   - pad = media_entity_remote_source(pad);
  248 + pad = media_entity_remote_pad(pad);
249 249 if (pad == NULL ||
250 250 pad->entity->type != MEDIA_ENT_T_V4L2_SUBDEV)
251 251 break;
... ... @@ -667,7 +667,7 @@
667 667 return -EINVAL;
668 668 }
669 669 /* get the remote pad */
670   - remote = media_entity_remote_source(&video->pad);
  670 + remote = media_entity_remote_pad(&video->pad);
671 671 if (remote == NULL) {
672 672 v4l2_err(&vpfe_dev->v4l2_dev,
673 673 "invalid remote pad for video node\n");
include/media/media-entity.h
... ... @@ -132,7 +132,7 @@
132 132 int media_entity_setup_link(struct media_link *link, u32 flags);
133 133 struct media_link *media_entity_find_link(struct media_pad *source,
134 134 struct media_pad *sink);
135   -struct media_pad *media_entity_remote_source(struct media_pad *pad);
  135 +struct media_pad *media_entity_remote_pad(struct media_pad *pad);
136 136  
137 137 struct media_entity *media_entity_get(struct media_entity *entity);
138 138 void media_entity_put(struct media_entity *entity);