[media] media framework: rename pads init function to media_entity_pads_init()
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Fri, 11 Dec 2015 09:44:40 +0000 (07:44 -0200)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:19:03 +0000 (12:19 -0200)
With the MC next gen rework, what's left for media_entity_init()
is to just initialize the PADs. However, certain devices, like
a FLASH led/light doesn't have any input or output PAD.

So, there's no reason why calling media_entity_init() would be
mandatory. Also, despite its name, what this function actually
does is to initialize the PADs data. So, rename it to
media_entity_pads_init() in order to reflect that.

The media entity actual init happens during entity register,
at media_device_register_entity(). We should move init of
num_links and num_backlinks to it.

Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
68 files changed:
Documentation/media-framework.txt
Documentation/video4linux/v4l2-framework.txt
Documentation/zh_CN/video4linux/v4l2-framework.txt
drivers/media/dvb-core/dvbdev.c
drivers/media/dvb-frontends/au8522_decoder.c
drivers/media/i2c/ad9389b.c
drivers/media/i2c/adp1653.c
drivers/media/i2c/adv7180.c
drivers/media/i2c/adv7511.c
drivers/media/i2c/adv7604.c
drivers/media/i2c/adv7842.c
drivers/media/i2c/as3645a.c
drivers/media/i2c/cx25840/cx25840-core.c
drivers/media/i2c/lm3560.c
drivers/media/i2c/lm3646.c
drivers/media/i2c/m5mols/m5mols_core.c
drivers/media/i2c/mt9m032.c
drivers/media/i2c/mt9p031.c
drivers/media/i2c/mt9t001.c
drivers/media/i2c/mt9v032.c
drivers/media/i2c/noon010pc30.c
drivers/media/i2c/ov2659.c
drivers/media/i2c/ov9650.c
drivers/media/i2c/s5c73m3/s5c73m3-core.c
drivers/media/i2c/s5k4ecgx.c
drivers/media/i2c/s5k5baf.c
drivers/media/i2c/s5k6a3.c
drivers/media/i2c/s5k6aa.c
drivers/media/i2c/smiapp/smiapp-core.c
drivers/media/i2c/tc358743.c
drivers/media/i2c/tvp514x.c
drivers/media/i2c/tvp7002.c
drivers/media/media-device.c
drivers/media/media-entity.c
drivers/media/platform/exynos4-is/fimc-capture.c
drivers/media/platform/exynos4-is/fimc-isp-video.c
drivers/media/platform/exynos4-is/fimc-isp.c
drivers/media/platform/exynos4-is/fimc-lite.c
drivers/media/platform/exynos4-is/fimc-m2m.c
drivers/media/platform/exynos4-is/mipi-csis.c
drivers/media/platform/omap3isp/ispccdc.c
drivers/media/platform/omap3isp/ispccp2.c
drivers/media/platform/omap3isp/ispcsi2.c
drivers/media/platform/omap3isp/isppreview.c
drivers/media/platform/omap3isp/ispresizer.c
drivers/media/platform/omap3isp/ispstat.c
drivers/media/platform/omap3isp/ispvideo.c
drivers/media/platform/s3c-camif/camif-capture.c
drivers/media/platform/vsp1/vsp1_entity.c
drivers/media/platform/vsp1/vsp1_video.c
drivers/media/platform/xilinx/xilinx-dma.c
drivers/media/platform/xilinx/xilinx-tpg.c
drivers/media/usb/au0828/au0828-video.c
drivers/media/usb/cx231xx/cx231xx-video.c
drivers/media/usb/uvc/uvc_entity.c
drivers/media/v4l2-core/tuner-core.c
drivers/media/v4l2-core/v4l2-flash-led-class.c
drivers/staging/media/davinci_vpfe/dm365_ipipe.c
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c
drivers/staging/media/davinci_vpfe/dm365_isif.c
drivers/staging/media/davinci_vpfe/dm365_resizer.c
drivers/staging/media/davinci_vpfe/vpfe_video.c
drivers/staging/media/omap4iss/iss_csi2.c
drivers/staging/media/omap4iss/iss_ipipe.c
drivers/staging/media/omap4iss/iss_ipipeif.c
drivers/staging/media/omap4iss/iss_resizer.c
drivers/staging/media/omap4iss/iss_video.c
include/media/media-entity.h

index b424de6c3bb330156e247206cc4ade6a4b471b6a..7fbfe4bd1f4765d7753d4152fe63d36ba2875614 100644 (file)
@@ -101,14 +101,18 @@ include/media/media-entity.h. The structure is usually embedded into a
 higher-level structure, such as a v4l2_subdev or video_device instance,
 although drivers can allocate entities directly.
 
-Drivers initialize entities by calling
+Drivers initialize entity pads by calling
 
-       media_entity_init(struct media_entity *entity, u16 num_pads,
+       media_entity_pads_init(struct media_entity *entity, u16 num_pads,
                          struct media_pad *pads);
 
-The media_entity name, type, flags, revision and group_id fields can be
-initialized before or after calling media_entity_init. Entities embedded in
-higher-level standard structures can have some of those fields set by the
+If no pads are needed, drivers could directly fill entity->num_pads
+with 0 and entity->pads with NULL or to call the above function that
+will do the same.
+
+The media_entity name, type, flags, revision and group_id fields should be
+initialized before calling media_device_register_entity(). Entities embedded
+in higher-level standard structures can have some of those fields set by the
 higher-level framework.
 
 As the number of pads is known in advance, the pads array is not allocated
@@ -116,10 +120,10 @@ dynamically but is managed by the entity driver. Most drivers will embed the
 pads array in a driver-specific structure, avoiding dynamic allocation.
 
 Drivers must set the direction of every pad in the pads array before calling
-media_entity_init. The function will initialize the other pads fields.
+media_entity_pads_init. The function will initialize the other pads fields.
 
 Unlike the number of pads, the total number of links isn't always known in
-advance by the entity driver. As an initial estimate, media_entity_init
+advance by the entity driver. As an initial estimate, media_entity_pads_init
 pre-allocates a number of links equal to the number of pads. The links array
 will be reallocated if it grows beyond the initial estimate.
 
index 2e0fc28fa12feee5c9853395e63b383362e4d9d4..fa41608ab2b4f48c4ecb4c012be76b7802dc2958 100644 (file)
@@ -295,12 +295,12 @@ module owner. This is done for you if you use the i2c helper functions.
 
 If integration with the media framework is needed, you must initialize the
 media_entity struct embedded in the v4l2_subdev struct (entity field) by
-calling media_entity_init():
+calling media_entity_pads_init(), if the entity has pads:
 
        struct media_pad *pads = &my_sd->pads;
        int err;
 
-       err = media_entity_init(&sd->entity, npads, pads);
+       err = media_entity_pads_init(&sd->entity, npads, pads);
 
 The pads array must have been previously initialized. There is no need to
 manually set the struct media_entity function and name fields, but the
@@ -695,12 +695,12 @@ difference is that the inode argument is omitted since it is never used.
 
 If integration with the media framework is needed, you must initialize the
 media_entity struct embedded in the video_device struct (entity field) by
-calling media_entity_init():
+calling media_entity_pads_init():
 
        struct media_pad *pad = &my_vdev->pad;
        int err;
 
-       err = media_entity_init(&vdev->entity, 1, pad);
+       err = media_entity_pads_init(&vdev->entity, 1, pad);
 
 The pads array must have been previously initialized. There is no need to
 manually set the struct media_entity type and name fields.
index ff815cb920318593a2adeafa088d69d6f27efca9..698660b7f21fd8d0453c12a1c29c0614557cf38c 100644 (file)
@@ -289,13 +289,13 @@ struct v4l2_subdev_ops {
 然后,你必须用一个唯一的名字初始化 subdev->name,并初始化模块的
 owner 域。若使用 i2c 辅助函数,这些都会帮你处理好。
 
-若需同媒体框架整合,你必须调用 media_entity_init() 初始化 v4l2_subdev
+若需同媒体框架整合,你必须调用 media_entity_pads_init() 初始化 v4l2_subdev
 结构体中的 media_entity 结构体(entity 域):
 
        struct media_pad *pads = &my_sd->pads;
        int err;
 
-       err = media_entity_init(&sd->entity, npads, pads);
+       err = media_entity_pads_init(&sd->entity, npads, pads);
 
 pads 数组必须预先初始化。无须手动设置 media_entity 的 type 和
 name 域,但如有必要,revision 域必须初始化。
@@ -596,13 +596,13 @@ void v4l2_disable_ioctl(struct video_device *vdev, unsigned int cmd);
 v4l2_file_operations 结构体是 file_operations 的一个子集。其主要
 区别在于:因 inode 参数从未被使用,它将被忽略。
 
-如果需要与媒体框架整合,你必须通过调用 media_entity_init() 初始化
+如果需要与媒体框架整合,你必须通过调用 media_entity_pads_init() 初始化
 嵌入在 video_device 结构体中的 media_entity(entity 域)结构体:
 
        struct media_pad *pad = &my_vdev->pad;
        int err;
 
-       err = media_entity_init(&vdev->entity, 1, pad);
+       err = media_entity_pads_init(&vdev->entity, 1, pad);
 
 pads 数组必须预先初始化。没有必要手动设置 media_entity 的 type 和
 name 域。
index 1d4e35693d09d7b0fd5839ab0bf5ae761fe3e98e..b56e00817d3fa2b34fb6ba181705621f8269de46 100644 (file)
@@ -245,7 +245,7 @@ static int dvb_create_tsout_entity(struct dvb_device *dvbdev,
                entity->function = MEDIA_ENT_F_IO_DTV;
                pads->flags = MEDIA_PAD_FL_SINK;
 
-               ret = media_entity_init(entity, 1, pads);
+               ret = media_entity_pads_init(entity, 1, pads);
                if (ret < 0)
                        return ret;
 
@@ -340,7 +340,7 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev,
        }
 
        if (npads) {
-               ret = media_entity_init(dvbdev->entity, npads, dvbdev->pads);
+               ret = media_entity_pads_init(dvbdev->entity, npads, dvbdev->pads);
                if (ret)
                        return ret;
        }
index 464a2beca30d7082d737251c1f93c616f52d78c0..73612c5353d1942c4daa9de76c58aa15591ebe4d 100644 (file)
@@ -768,7 +768,7 @@ static int au8522_probe(struct i2c_client *client,
        state->pads[AU8522_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_ATV_DECODER;
 
-       ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
+       ret = media_entity_pads_init(&sd->entity, ARRAY_SIZE(state->pads),
                                state->pads);
        if (ret < 0) {
                v4l_info(client, "failed to initialize media entity!\n");
index a02dc4925707c0b4cd23b91dc37bbcd4955c72d7..788967dadd2989c4c2f171acb347c8703e2181ae 100644 (file)
@@ -1158,7 +1158,7 @@ static int ad9389b_probe(struct i2c_client *client, const struct i2c_device_id *
        state->rgb_quantization_range_ctrl->is_private = true;
 
        state->pad.flags = MEDIA_PAD_FL_SINK;
-       err = media_entity_init(&sd->entity, 1, &state->pad);
+       err = media_entity_pads_init(&sd->entity, 1, &state->pad);
        if (err)
                goto err_hdl;
 
index 7150f35d5935475f24bfa9e2f7ab8088726351a1..7e9cbf757e956b817e465249669b148cd9b38cb0 100644 (file)
@@ -512,7 +512,7 @@ static int adp1653_probe(struct i2c_client *client,
        if (ret)
                goto free_and_quit;
 
-       ret = media_entity_init(&flash->subdev.entity, 0, NULL);
+       ret = media_entity_pads_init(&flash->subdev.entity, 0, NULL);
        if (ret < 0)
                goto free_and_quit;
 
index 2ebe9efdfc1b0ddfb3ab9c8f2d5e4ab6a43d1c7d..ff57c1dcb8aff35a2b1487307655305a9d626cc5 100644 (file)
@@ -1214,7 +1214,7 @@ static int adv7180_probe(struct i2c_client *client,
 
        state->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.flags |= MEDIA_ENT_F_ATV_DECODER;
-       ret = media_entity_init(&sd->entity, 1, &state->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &state->pad);
        if (ret)
                goto err_free_ctrl;
 
index cbcf81b1d29e5a68410faa8d4d5912252def82ec..471fd23b5c5c7c3c90cd5a7714c0140694759d21 100644 (file)
@@ -1482,7 +1482,7 @@ static int adv7511_probe(struct i2c_client *client, const struct i2c_device_id *
        state->rgb_quantization_range_ctrl->is_private = true;
 
        state->pad.flags = MEDIA_PAD_FL_SINK;
-       err = media_entity_init(&sd->entity, 1, &state->pad);
+       err = media_entity_pads_init(&sd->entity, 1, &state->pad);
        if (err)
                goto err_hdl;
 
index c2df7e8053f3dd2730de0f7bc93e34f16c064916..f8dd7505b5294ff167352a1d3ce8823605916db7 100644 (file)
@@ -3208,7 +3208,7 @@ static int adv76xx_probe(struct i2c_client *client,
                state->pads[i].flags = MEDIA_PAD_FL_SINK;
        state->pads[state->source_pad].flags = MEDIA_PAD_FL_SOURCE;
 
-       err = media_entity_init(&sd->entity, state->source_pad + 1,
+       err = media_entity_pads_init(&sd->entity, state->source_pad + 1,
                                state->pads);
        if (err)
                goto err_work_queues;
index b5013a937254b59b0b1d6350da515af9c76cddab..5fbb788e7b599aa4dbdbf8a59bc352fda4d8af13 100644 (file)
@@ -3309,7 +3309,7 @@ static int adv7842_probe(struct i2c_client *client,
                        adv7842_delayed_work_enable_hotplug);
 
        state->pad.flags = MEDIA_PAD_FL_SOURCE;
-       err = media_entity_init(&sd->entity, 1, &state->pad);
+       err = media_entity_pads_init(&sd->entity, 1, &state->pad);
        if (err)
                goto err_work_queues;
 
index b1bc4d0f76f2423b261eaf70adbb62b1f8941c32..2e90e4094b7960777296c0e24a4b3ed74706ac5a 100644 (file)
@@ -827,7 +827,7 @@ static int as3645a_probe(struct i2c_client *client,
        if (ret < 0)
                goto done;
 
-       ret = media_entity_init(&flash->subdev.entity, 0, NULL);
+       ret = media_entity_pads_init(&flash->subdev.entity, 0, NULL);
        if (ret < 0)
                goto done;
 
index 4d975aa5be36fe065e49383305463903dc54b37c..07a3e71731441b8767f125ebf4261d545bcd9576 100644 (file)
@@ -5213,7 +5213,7 @@ static int cx25840_probe(struct i2c_client *client,
        state->pads[CX25840_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_ATV_DECODER;
 
-       ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
+       ret = media_entity_pads_init(&sd->entity, ARRAY_SIZE(state->pads),
                                state->pads);
        if (ret < 0) {
                v4l_info(client, "failed to initialize media entity!\n");
index 98266f707ea0073f57be2a84b6634ab391c9c24c..251a2aaf98c3b2665061266f31a248268d2f051e 100644 (file)
@@ -365,7 +365,7 @@ static int lm3560_subdev_init(struct lm3560_flash *flash,
        rval = lm3560_init_controls(flash, led_no);
        if (rval)
                goto err_out;
-       rval = media_entity_init(&flash->subdev_led[led_no].entity, 0, NULL);
+       rval = media_entity_pads_init(&flash->subdev_led[led_no].entity, 0, NULL);
        if (rval < 0)
                goto err_out;
        flash->subdev_led[led_no].entity.function = MEDIA_ENT_F_FLASH;
index ba5ee0d7a78e8bc86505c0046bf1869f920cf032..7e9967af36ecd36a74dff0bc012bc2a2bed8fb72 100644 (file)
@@ -282,7 +282,7 @@ static int lm3646_subdev_init(struct lm3646_flash *flash)
        rval = lm3646_init_controls(flash);
        if (rval)
                goto err_out;
-       rval = media_entity_init(&flash->subdev_led.entity, 0, NULL);
+       rval = media_entity_pads_init(&flash->subdev_led.entity, 0, NULL);
        if (rval < 0)
                goto err_out;
        flash->subdev_led.entity.function = MEDIA_ENT_F_FLASH;
index bec5cea23b65e205a3932d1b1488d70e8f77caac..acb804bceccbc745b06da770ef7eb541d53118e6 100644 (file)
@@ -975,7 +975,7 @@ static int m5mols_probe(struct i2c_client *client,
 
        sd->internal_ops = &m5mols_subdev_internal_ops;
        info->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&sd->entity, 1, &info->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &info->pad);
        if (ret < 0)
                return ret;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
index a2a450839ca121177ccea3d15a970e3a77c54874..da076796999ee6ee5e3ee9ae17d65856ce744629 100644 (file)
@@ -799,7 +799,7 @@ static int mt9m032_probe(struct i2c_client *client,
 
        sensor->subdev.ctrl_handler = &sensor->ctrls;
        sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&sensor->subdev.entity, 1, &sensor->pad);
+       ret = media_entity_pads_init(&sensor->subdev.entity, 1, &sensor->pad);
        if (ret < 0)
                goto error_ctrl;
 
index 165f29cddca6d1772ab08c01435139f0b6980d21..237737fec09c15fdc6b3148c10a602860d3b5bff 100644 (file)
@@ -1112,7 +1112,7 @@ static int mt9p031_probe(struct i2c_client *client,
        mt9p031->subdev.internal_ops = &mt9p031_subdev_internal_ops;
 
        mt9p031->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad);
+       ret = media_entity_pads_init(&mt9p031->subdev.entity, 1, &mt9p031->pad);
        if (ret < 0)
                goto done;
 
index 7d3df84651d8851f8e9f064fe3c459d1dee4cfa2..702d562f8e39a2a4ae26511eecbc3f42ada8e5fd 100644 (file)
@@ -933,7 +933,7 @@ static int mt9t001_probe(struct i2c_client *client,
        mt9t001->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        mt9t001->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&mt9t001->subdev.entity, 1, &mt9t001->pad);
+       ret = media_entity_pads_init(&mt9t001->subdev.entity, 1, &mt9t001->pad);
 
 done:
        if (ret < 0) {
index b4f0f042c6c3b3a358b0adf6f56d5922a5cb9a17..2e1d116a64e7b43eb1f6e886f842d9ef296664c9 100644 (file)
@@ -1046,7 +1046,7 @@ static int mt9v032_probe(struct i2c_client *client,
        mt9v032->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        mt9v032->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad);
+       ret = media_entity_pads_init(&mt9v032->subdev.entity, 1, &mt9v032->pad);
        if (ret < 0)
                goto err;
 
index 47ea3f79eacc4cb5689b005166bcd53ec5e2bb2b..30cb90b88d7551515abb601dd578216ee60bc204 100644 (file)
@@ -780,7 +780,7 @@ static int noon010_probe(struct i2c_client *client,
 
        info->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
-       ret = media_entity_init(&sd->entity, 1, &info->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &info->pad);
        if (ret < 0)
                goto np_err;
 
index cf8e71610248dd596005963251a7ecbf7276e5c6..02b9a3440557b49e9ad7dd366d201ebcd6e962ed 100644 (file)
@@ -1446,7 +1446,7 @@ static int ov2659_probe(struct i2c_client *client,
 #if defined(CONFIG_MEDIA_CONTROLLER)
        ov2659->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
-       ret = media_entity_init(&sd->entity, 1, &ov2659->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &ov2659->pad);
        if (ret < 0) {
                v4l2_ctrl_handler_free(&ov2659->ctrls);
                return ret;
index adb4aab45c109a37924a393ff1e074c5e72b68c4..a0b3c9bde53d85531283982c9a526ea9395f4c19 100644 (file)
@@ -1501,7 +1501,7 @@ static int ov965x_probe(struct i2c_client *client,
 
        ov965x->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
-       ret = media_entity_init(&sd->entity, 1, &ov965x->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &ov965x->pad);
        if (ret < 0)
                return ret;
 
index 3d578f2ce7b2f474e15d949a67c568894300eefe..57b3d27993a40ffadf7d42a5b791e71f3f74eb76 100644 (file)
@@ -1690,7 +1690,7 @@ static int s5c73m3_probe(struct i2c_client *client,
        state->sensor_pads[S5C73M3_ISP_PAD].flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
 
-       ret = media_entity_init(&sd->entity, S5C73M3_NUM_PADS,
+       ret = media_entity_pads_init(&sd->entity, S5C73M3_NUM_PADS,
                                                        state->sensor_pads);
        if (ret < 0)
                return ret;
@@ -1706,7 +1706,7 @@ static int s5c73m3_probe(struct i2c_client *client,
        state->oif_pads[OIF_SOURCE_PAD].flags = MEDIA_PAD_FL_SOURCE;
        oif_sd->entity.function = MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN;
 
-       ret = media_entity_init(&oif_sd->entity, OIF_NUM_PADS,
+       ret = media_entity_pads_init(&oif_sd->entity, OIF_NUM_PADS,
                                                        state->oif_pads);
        if (ret < 0)
                return ret;
index bacec84e773f6195f5d0d4b38f6f6caba151e015..8a0f22da590ffe7f187e43bc4ba67438c16f9695 100644 (file)
@@ -962,7 +962,7 @@ static int s5k4ecgx_probe(struct i2c_client *client,
 
        priv->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
-       ret = media_entity_init(&sd->entity, 1, &priv->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &priv->pad);
        if (ret)
                return ret;
 
index 564938ab2abd9ba307f1e5a1101a0a439b223d20..fc3a5a8e6c9c7ebafb5b8a3ba97e1fa7cbe564fd 100644 (file)
@@ -1905,7 +1905,7 @@ static int s5k5baf_configure_subdevs(struct s5k5baf *state,
 
        state->cis_pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
-       ret = media_entity_init(&sd->entity, NUM_CIS_PADS, &state->cis_pad);
+       ret = media_entity_pads_init(&sd->entity, NUM_CIS_PADS, &state->cis_pad);
        if (ret < 0)
                goto err;
 
@@ -1920,7 +1920,7 @@ static int s5k5baf_configure_subdevs(struct s5k5baf *state,
        state->pads[PAD_CIS].flags = MEDIA_PAD_FL_SINK;
        state->pads[PAD_OUT].flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN;
-       ret = media_entity_init(&sd->entity, NUM_ISP_PADS, state->pads);
+       ret = media_entity_pads_init(&sd->entity, NUM_ISP_PADS, state->pads);
 
        if (!ret)
                return 0;
index 2434a79447818546214a6511038550eda09adaa2..b9e43ffa50859caeb4ce2b8343f660a598d249ff 100644 (file)
@@ -333,7 +333,7 @@ static int s5k6a3_probe(struct i2c_client *client,
        sensor->format.height = S5K6A3_DEFAULT_HEIGHT;
 
        sensor->pad.flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&sd->entity, 1, &sensor->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &sensor->pad);
        if (ret < 0)
                return ret;
 
index d71d104441bd43d739cb2c27386315d9692d8382..faee11383cb70d7833737ffd7c368ceacbcb50ae 100644 (file)
@@ -1578,7 +1578,7 @@ static int s5k6aa_probe(struct i2c_client *client,
 
        s5k6aa->pad.flags = MEDIA_PAD_FL_SOURCE;
        sd->entity.function = MEDIA_ENT_F_CAM_SENSOR;
-       ret = media_entity_init(&sd->entity, 1, &s5k6aa->pad);
+       ret = media_entity_pads_init(&sd->entity, 1, &s5k6aa->pad);
        if (ret)
                return ret;
 
index 3eaa69ee341b20ce00b151ca3e3b431ef067a1f2..a215efe7a8bac0ec3972d41e0b23cd7bffd336d2 100644 (file)
@@ -2487,11 +2487,11 @@ static int smiapp_register_subdevs(struct smiapp_sensor *sensor)
                if (!last)
                        continue;
 
-               rval = media_entity_init(&this->sd.entity,
+               rval = media_entity_pads_init(&this->sd.entity,
                                         this->npads, this->pads);
                if (rval) {
                        dev_err(&client->dev,
-                               "media_entity_init failed\n");
+                               "media_entity_pads_init failed\n");
                        return rval;
                }
 
@@ -3077,7 +3077,7 @@ static int smiapp_probe(struct i2c_client *client,
        sensor->src->sensor = sensor;
 
        sensor->src->pads[0].flags = MEDIA_PAD_FL_SOURCE;
-       rval = media_entity_init(&sensor->src->sd.entity, 2,
+       rval = media_entity_pads_init(&sensor->src->sd.entity, 2,
                                 sensor->src->pads);
        if (rval < 0)
                return rval;
index 78e5b644d4006066968c4fb41ec9e22e9562ee40..3397eb99c67b0269beecf3cc47c0076758d53885 100644 (file)
@@ -1889,7 +1889,7 @@ static int tc358743_probe(struct i2c_client *client,
        }
 
        state->pad.flags = MEDIA_PAD_FL_SOURCE;
-       err = media_entity_init(&sd->entity, 1, &state->pad);
+       err = media_entity_pads_init(&sd->entity, 1, &state->pad);
        if (err < 0)
                goto err_hdl;
 
index 455dd4e6a1dad0c7a5b106c38f6ed36e0fb4cf8f..7fa5f1e4fe3798155011263f9e4bdd0ad6b2955c 100644 (file)
@@ -1097,7 +1097,7 @@ tvp514x_probe(struct i2c_client *client, const struct i2c_device_id *id)
        decoder->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        decoder->sd.entity.flags |= MEDIA_ENT_F_ATV_DECODER;
 
-       ret = media_entity_init(&decoder->sd.entity, 1, &decoder->pad);
+       ret = media_entity_pads_init(&decoder->sd.entity, 1, &decoder->pad);
        if (ret < 0) {
                v4l2_err(sd, "%s decoder driver failed to register !!\n",
                         sd->name);
index 216a07956fe9efe0ddf20c7f68a75875e8009e7b..83c79fa5f61de1b7155cb42ff69672f87036b5ba 100644 (file)
@@ -1014,7 +1014,7 @@ static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
        device->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        device->sd.entity.flags |= MEDIA_ENT_F_ATV_DECODER;
 
-       error = media_entity_init(&device->sd.entity, 1, &device->pad);
+       error = media_entity_pads_init(&device->sd.entity, 1, &device->pad);
        if (error < 0)
                return error;
 #endif
index 14bd568e2f41dc59e8b5432e44ada436d4245300..b8cd7733a31c60b5c3636743f8eb06aa88c658c1 100644 (file)
@@ -623,6 +623,8 @@ int __must_check media_device_register_entity(struct media_device *mdev,
        WARN_ON(entity->graph_obj.mdev != NULL);
        entity->graph_obj.mdev = mdev;
        INIT_LIST_HEAD(&entity->links);
+       entity->num_links = 0;
+       entity->num_backlinks = 0;
 
        spin_lock(&mdev->lock);
        /* Initialize media_gobj embedded at the entity */
index 07f2dc6c2df6b81919702e72cb1818192515e01f..ef2102ac0c66d9263750f45f05a1a646b02f9134 100644 (file)
@@ -197,7 +197,7 @@ void media_gobj_remove(struct media_gobj *gobj)
 }
 
 /**
- * media_entity_init - Initialize a media entity
+ * media_entity_pads_init - Initialize a media entity
  *
  * @num_pads: Total number of sink and source pads.
  * @pads: Array of 'num_pads' pads.
@@ -216,18 +216,15 @@ void media_gobj_remove(struct media_gobj *gobj)
  * number of allocated elements.
  *
  * The pads array is managed by the entity driver and passed to
- * media_entity_init() where its pointer will be stored in the entity structure.
+ * media_entity_pads_init() where its pointer will be stored in the entity structure.
  */
 int
-media_entity_init(struct media_entity *entity, u16 num_pads,
+media_entity_pads_init(struct media_entity *entity, u16 num_pads,
                  struct media_pad *pads)
 {
        struct media_device *mdev = entity->graph_obj.mdev;
        unsigned int i;
 
-       entity->group_id = 0;
-       entity->num_links = 0;
-       entity->num_backlinks = 0;
        entity->num_pads = num_pads;
        entity->pads = pads;
 
@@ -247,7 +244,7 @@ media_entity_init(struct media_entity *entity, u16 num_pads,
 
        return 0;
 }
-EXPORT_SYMBOL_GPL(media_entity_init);
+EXPORT_SYMBOL_GPL(media_entity_pads_init);
 
 void
 media_entity_cleanup(struct media_entity *entity)
index 48a826372d3d563ae3ecb4d9ce5beee42e063b96..bf47d3b9cbe77e5dce9b1955c8280070afb5e3d0 100644 (file)
@@ -1799,7 +1799,7 @@ static int fimc_register_capture_device(struct fimc_dev *fimc,
        vid_cap->wb_fmt.code = fmt->mbus_code;
 
        vid_cap->vd_pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&vfd->entity, 1, &vid_cap->vd_pad);
+       ret = media_entity_pads_init(&vfd->entity, 1, &vid_cap->vd_pad);
        if (ret)
                goto err_free_ctx;
 
@@ -1891,7 +1891,7 @@ int fimc_initialize_capture_subdev(struct fimc_dev *fimc)
        fimc->vid_cap.sd_pads[FIMC_SD_PAD_SINK_CAM].flags = MEDIA_PAD_FL_SINK;
        fimc->vid_cap.sd_pads[FIMC_SD_PAD_SINK_FIFO].flags = MEDIA_PAD_FL_SINK;
        fimc->vid_cap.sd_pads[FIMC_SD_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&sd->entity, FIMC_SD_PADS_NUM,
+       ret = media_entity_pads_init(&sd->entity, FIMC_SD_PADS_NUM,
                                fimc->vid_cap.sd_pads);
        if (ret)
                return ret;
index 9c7794bcf0c32019d5b5d30f51dc23de0a187a82..bf9261eb57a15c37a8b82fb3197a94649e4cc9c6 100644 (file)
@@ -616,7 +616,7 @@ int fimc_isp_video_device_register(struct fimc_isp *isp,
        vdev->lock = &isp->video_lock;
 
        iv->pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&vdev->entity, 1, &iv->pad);
+       ret = media_entity_pads_init(&vdev->entity, 1, &iv->pad);
        if (ret < 0)
                return ret;
 
index f52eebf765c17828930d0b8b1a1549caef2f03d8..293b807020c49efd10ab803a608fa1f3d5863e13 100644 (file)
@@ -708,7 +708,7 @@ int fimc_isp_subdev_create(struct fimc_isp *isp)
        isp->subdev_pads[FIMC_ISP_SD_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
        isp->subdev_pads[FIMC_ISP_SD_PAD_SRC_FIFO].flags = MEDIA_PAD_FL_SOURCE;
        isp->subdev_pads[FIMC_ISP_SD_PAD_SRC_DMA].flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&sd->entity, FIMC_ISP_SD_PADS_NUM,
+       ret = media_entity_pads_init(&sd->entity, FIMC_ISP_SD_PADS_NUM,
                                isp->subdev_pads);
        if (ret)
                return ret;
index 957cf144a6752876d92e8f41900a8872b2f0e4b2..e85649147dc8d9e213f05a2a4de005b1fc073e75 100644 (file)
@@ -1314,7 +1314,7 @@ static int fimc_lite_subdev_registered(struct v4l2_subdev *sd)
                return ret;
 
        fimc->vd_pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&vfd->entity, 1, &fimc->vd_pad);
+       ret = media_entity_pads_init(&vfd->entity, 1, &fimc->vd_pad);
        if (ret < 0)
                return ret;
 
@@ -1428,7 +1428,7 @@ static int fimc_lite_create_capture_subdev(struct fimc_lite *fimc)
        fimc->subdev_pads[FLITE_SD_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
        fimc->subdev_pads[FLITE_SD_PAD_SOURCE_DMA].flags = MEDIA_PAD_FL_SOURCE;
        fimc->subdev_pads[FLITE_SD_PAD_SOURCE_ISP].flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&sd->entity, FLITE_SD_PADS_NUM,
+       ret = media_entity_pads_init(&sd->entity, FLITE_SD_PADS_NUM,
                                fimc->subdev_pads);
        if (ret)
                return ret;
index 8ff4e6f76b8489eb5aec6fb100530b9c03f4f0a0..55ec4c99d484a14ebfe3ee8763b68166e7abc93d 100644 (file)
@@ -739,7 +739,7 @@ int fimc_register_m2m_device(struct fimc_dev *fimc,
                return PTR_ERR(fimc->m2m.m2m_dev);
        }
 
-       ret = media_entity_init(&vfd->entity, 0, NULL);
+       ret = media_entity_pads_init(&vfd->entity, 0, NULL);
        if (ret)
                goto err_me;
 
index 8847797b0d0b4ee8ed15868366e951cceb74c638..ac5e50e595be83cd7ac973a6eab1d5866fca1d1b 100644 (file)
@@ -866,7 +866,7 @@ static int s5pcsis_probe(struct platform_device *pdev)
 
        state->pads[CSIS_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
        state->pads[CSIS_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
-       ret = media_entity_init(&state->sd.entity,
+       ret = media_entity_pads_init(&state->sd.entity,
                                CSIS_PADS_NUM, state->pads);
        if (ret < 0)
                goto e_clkdis;
index f0e530c981888683a666d3c115d217022d8e9d92..dae674cd3f74e32414059c4a4aea553ef4b433b8 100644 (file)
@@ -2655,7 +2655,7 @@ static int ccdc_init_entities(struct isp_ccdc_device *ccdc)
        pads[CCDC_PAD_SOURCE_OF].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &ccdc_media_ops;
-       ret = media_entity_init(me, CCDC_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, CCDC_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index ae3038e643ccf03b63e12fe3baf12511c5a6cfb0..0c790b25f6f9bb2c0a10153df4115dc10596dc00 100644 (file)
@@ -1076,7 +1076,7 @@ static int ccp2_init_entities(struct isp_ccp2_device *ccp2)
        pads[CCP2_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &ccp2_media_ops;
-       ret = media_entity_init(me, CCP2_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, CCP2_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index b1617f7efdee296e062874cb135cd80796254072..f50f6b305204cb4cc2cfa39520961b1cafcc1989 100644 (file)
@@ -1250,7 +1250,7 @@ static int csi2_init_entities(struct isp_csi2_device *csi2)
                                    | MEDIA_PAD_FL_MUST_CONNECT;
 
        me->ops = &csi2_media_ops;
-       ret = media_entity_init(me, CSI2_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, CSI2_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index cfb2debb02bfef56e7fac55d3213c81c8f0c6ffd..c300cb7219e9ff51cdc5c5fcc68f2885fd8763b7 100644 (file)
@@ -2287,7 +2287,7 @@ static int preview_init_entities(struct isp_prev_device *prev)
        pads[PREV_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &preview_media_ops;
-       ret = media_entity_init(me, PREV_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, PREV_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index e3ecf1787fc47e694a8dd8906365ab1f67a91813..cd0a9f6e1fedf8e1cfcfd139ac0d7dc6e30fc976 100644 (file)
@@ -1733,7 +1733,7 @@ static int resizer_init_entities(struct isp_res_device *res)
        pads[RESZ_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &resizer_media_ops;
-       ret = media_entity_init(me, RESZ_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, RESZ_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index f7a5eee9f11d53921b700dbf46324f9453cb3c51..1b9217d3b1b6af3b01a2979cc9a7cea28c027718 100644 (file)
@@ -1028,7 +1028,7 @@ static int isp_stat_init_entities(struct ispstat *stat, const char *name,
        stat->pad.flags = MEDIA_PAD_FL_SINK | MEDIA_PAD_FL_MUST_CONNECT;
        me->ops = NULL;
 
-       return media_entity_init(me, 1, &stat->pad);
+       return media_entity_pads_init(me, 1, &stat->pad);
 }
 
 int omap3isp_stat_init(struct ispstat *stat, const char *name,
index 768efd775abca19a886eee998246700026767779..1240b06202f0484590bbc7f407adef7c5a1fe6c7 100644 (file)
@@ -1368,7 +1368,7 @@ int omap3isp_video_init(struct isp_video *video, const char *name)
        if (IS_ERR(video->alloc_ctx))
                return PTR_ERR(video->alloc_ctx);
 
-       ret = media_entity_init(&video->video.entity, 1, &video->pad);
+       ret = media_entity_pads_init(&video->video.entity, 1, &video->pad);
        if (ret < 0) {
                vb2_dma_contig_cleanup_ctx(video->alloc_ctx);
                return ret;
index 05bfa9d08b19e5cc2853140289b80b4085e75dee..bd060ef5d1e1fc6c61b616090c84a41c6aee75eb 100644 (file)
@@ -1144,7 +1144,7 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
                goto err_vd_rel;
 
        vp->pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&vfd->entity, 1, &vp->pad);
+       ret = media_entity_pads_init(&vfd->entity, 1, &vp->pad);
        if (ret)
                goto err_vd_rel;
 
@@ -1559,7 +1559,7 @@ int s3c_camif_create_subdev(struct camif_dev *camif)
        camif->pads[CAMIF_SD_PAD_SOURCE_C].flags = MEDIA_PAD_FL_SOURCE;
        camif->pads[CAMIF_SD_PAD_SOURCE_P].flags = MEDIA_PAD_FL_SOURCE;
 
-       ret = media_entity_init(&sd->entity, CAMIF_SD_PADS_NUM,
+       ret = media_entity_pads_init(&sd->entity, CAMIF_SD_PADS_NUM,
                                camif->pads);
        if (ret)
                return ret;
index 619942ff2058f41d6929464218e7ce36f8cfcfde..d7308530952fdf179ab9ddfe2e3b00a90b7c7a54 100644 (file)
@@ -219,7 +219,7 @@ int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
        entity->pads[num_pads - 1].flags = MEDIA_PAD_FL_SOURCE;
 
        /* Initialize the media entity. */
-       return media_entity_init(&entity->subdev.entity, num_pads,
+       return media_entity_pads_init(&entity->subdev.entity, num_pads,
                                 entity->pads);
 }
 
index 024d10de3740dc14fd551cd36d49dc295898f297..e3304303dce3f2a4fc04cb9b160f85cfb914cd9c 100644 (file)
@@ -1192,7 +1192,7 @@ int vsp1_video_init(struct vsp1_video *video, struct vsp1_entity *rwpf)
        video->pipe.state = VSP1_PIPELINE_STOPPED;
 
        /* Initialize the media entity... */
-       ret = media_entity_init(&video->video.entity, 1, &video->pad);
+       ret = media_entity_pads_init(&video->video.entity, 1, &video->pad);
        if (ret < 0)
                return ret;
 
index b69c9630114da0aea56162bc0612b12f9ca7cb5c..0181ff402a5ab97b949bff6b6b8f754a5c7f5b39 100644 (file)
@@ -675,7 +675,7 @@ int xvip_dma_init(struct xvip_composite_device *xdev, struct xvip_dma *dma,
        dma->pad.flags = type == V4L2_BUF_TYPE_VIDEO_CAPTURE
                       ? MEDIA_PAD_FL_SINK : MEDIA_PAD_FL_SOURCE;
 
-       ret = media_entity_init(&dma->video.entity, 1, &dma->pad);
+       ret = media_entity_pads_init(&dma->video.entity, 1, &dma->pad);
        if (ret < 0)
                goto error;
 
index c09ca513a9dc5d9b7be7ac05d03cc2a23fbd4269..2ec1f6c4b27421d81dae68f62a9221178b579d55 100644 (file)
@@ -838,7 +838,7 @@ static int xtpg_probe(struct platform_device *pdev)
        subdev->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        subdev->entity.ops = &xtpg_media_ops;
 
-       ret = media_entity_init(&subdev->entity, xtpg->npads, xtpg->pads);
+       ret = media_entity_pads_init(&subdev->entity, xtpg->npads, xtpg->pads);
        if (ret < 0)
                goto error;
 
index 839361c035ff3cc590544df2813795bedb1a0200..8c54fd21022e443ee03e2f1b852208c4a03b938e 100644 (file)
@@ -1810,12 +1810,12 @@ static void au0828_analog_create_entities(struct au0828_dev *dev)
 
        /* Initialize Video and VBI pads */
        dev->video_pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad);
+       ret = media_entity_pads_init(&dev->vdev.entity, 1, &dev->video_pad);
        if (ret < 0)
                pr_err("failed to initialize video media entity!\n");
 
        dev->vbi_pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
+       ret = media_entity_pads_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
        if (ret < 0)
                pr_err("failed to initialize vbi media entity!\n");
 
@@ -1847,7 +1847,7 @@ static void au0828_analog_create_entities(struct au0828_dev *dev)
                        break;
                }
 
-               ret = media_entity_init(ent, 1, &dev->input_pad[i]);
+               ret = media_entity_pads_init(ent, 1, &dev->input_pad[i]);
                if (ret < 0)
                        pr_err("failed to initialize input pad[%d]!\n", i);
 
index 905ccd7cbc6da12d82e44238c4c6a4078caf1cde..9b88cd8127ac2519ffa794caaad0954bb4abd90f 100644 (file)
@@ -2175,7 +2175,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
        cx231xx_vdev_init(dev, &dev->vdev, &cx231xx_video_template, "video");
 #if defined(CONFIG_MEDIA_CONTROLLER)
        dev->video_pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad);
+       ret = media_entity_pads_init(&dev->vdev.entity, 1, &dev->video_pad);
        if (ret < 0)
                dev_err(dev->dev, "failed to initialize video media entity!\n");
 #endif
@@ -2202,7 +2202,7 @@ int cx231xx_register_analog_devices(struct cx231xx *dev)
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
        dev->vbi_pad.flags = MEDIA_PAD_FL_SINK;
-       ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
+       ret = media_entity_pads_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
        if (ret < 0)
                dev_err(dev->dev, "failed to initialize vbi media entity!\n");
 #endif
index 7f82b65b238e12249ae0b046a6522b98ff9d302b..38e893a1408bc8c485a0a728839e6fa598648702 100644 (file)
@@ -94,10 +94,10 @@ static int uvc_mc_init_entity(struct uvc_entity *entity)
                strlcpy(entity->subdev.name, entity->name,
                        sizeof(entity->subdev.name));
 
-               ret = media_entity_init(&entity->subdev.entity,
+               ret = media_entity_pads_init(&entity->subdev.entity,
                                        entity->num_pads, entity->pads);
        } else if (entity->vdev != NULL) {
-               ret = media_entity_init(&entity->vdev->entity,
+               ret = media_entity_pads_init(&entity->vdev->entity,
                                        entity->num_pads, entity->pads);
                if (entity->flags & UVC_ENTITY_FLAG_DEFAULT)
                        entity->vdev->entity.flags |= MEDIA_ENT_FL_DEFAULT;
index 05fc4df61b85fa53fd69508f72dd4e6ef795398c..76496fd282aa532da3e84960ea7dddeedc013ccf 100644 (file)
@@ -701,7 +701,7 @@ register_client:
        t->sd.entity.function = MEDIA_ENT_F_TUNER;
        t->sd.entity.name = t->name;
 
-       ret = media_entity_init(&t->sd.entity, TUNER_NUM_PADS, &t->pad[0]);
+       ret = media_entity_pads_init(&t->sd.entity, TUNER_NUM_PADS, &t->pad[0]);
        if (ret < 0) {
                tuner_err("failed to initialize media entity!\n");
                kfree(t);
index 5c686a24712ba27765e7d7c1ae5d13747a11b546..13d5a36bc5d871c2587a2a165f9f66bbe137997e 100644 (file)
@@ -651,7 +651,7 @@ struct v4l2_flash *v4l2_flash_init(
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
        strlcpy(sd->name, config->dev_name, sizeof(sd->name));
 
-       ret = media_entity_init(&sd->entity, 0, NULL);
+       ret = media_entity_pads_init(&sd->entity, 0, NULL);
        if (ret < 0)
                return ERR_PTR(ret);
 
index 77837afab0ce65a47f65f7b0809cbc8f9518c606..ac78ed2f8bccaa650d27b0620f52e2b0715bc265 100644 (file)
@@ -1843,7 +1843,7 @@ vpfe_ipipe_init(struct vpfe_ipipe_device *ipipe, struct platform_device *pdev)
        v4l2_ctrl_handler_setup(&ipipe->ctrls);
        sd->ctrl_handler = &ipipe->ctrls;
 
-       return media_entity_init(me, IPIPE_PADS_NUM, pads);
+       return media_entity_pads_init(me, IPIPE_PADS_NUM, pads);
 }
 
 /*
index b66584ecb6933bd6ec5db538d29da062fdcb1880..a54c60fce3d5b10bd026d0095ff76bdfbb6a5709 100644 (file)
@@ -1031,7 +1031,7 @@ int vpfe_ipipeif_init(struct vpfe_ipipeif_device *ipipeif,
        ipipeif->output = IPIPEIF_OUTPUT_NONE;
        me->ops = &ipipeif_media_ops;
 
-       ret = media_entity_init(me, IPIPEIF_NUM_PADS, pads);
+       ret = media_entity_pads_init(me, IPIPEIF_NUM_PADS, pads);
        if (ret)
                goto fail;
 
index 8ca0c1297ec8c4f0e7b76a768f8db7e1ab6be50e..b35667afb73f61afcd0ddfeda294e480511be9ea 100644 (file)
@@ -2057,7 +2057,7 @@ int vpfe_isif_init(struct vpfe_isif_device *isif, struct platform_device *pdev)
        isif->input = ISIF_INPUT_NONE;
        isif->output = ISIF_OUTPUT_NONE;
        me->ops = &isif_media_ops;
-       status = media_entity_init(me, ISIF_PADS_NUM, pads);
+       status = media_entity_pads_init(me, ISIF_PADS_NUM, pads);
        if (status)
                goto isif_fail;
        isif->video_out.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
index ba887efd226a3764cb94d98f741e2693e7f04683..669ae3f9791fd351abb9fce41558e0c8271639b5 100644 (file)
@@ -1915,7 +1915,7 @@ int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz,
        vpfe_rsz->crop_resizer.output2 = RESIZER_CROP_OUTPUT_NONE;
        vpfe_rsz->crop_resizer.rsz_device = vpfe_rsz;
        me->ops = &resizer_media_ops;
-       ret = media_entity_init(me, RESIZER_CROP_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, RESIZER_CROP_PADS_NUM, pads);
        if (ret)
                return ret;
 
@@ -1937,7 +1937,7 @@ int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz,
        vpfe_rsz->resizer_a.output = RESIZER_OUTPUT_NONE;
        vpfe_rsz->resizer_a.rsz_device = vpfe_rsz;
        me->ops = &resizer_media_ops;
-       ret = media_entity_init(me, RESIZER_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, RESIZER_PADS_NUM, pads);
        if (ret)
                return ret;
 
@@ -1959,7 +1959,7 @@ int vpfe_resizer_init(struct vpfe_resizer_device *vpfe_rsz,
        vpfe_rsz->resizer_b.output = RESIZER_OUTPUT_NONE;
        vpfe_rsz->resizer_b.rsz_device = vpfe_rsz;
        me->ops = &resizer_media_ops;
-       ret = media_entity_init(me, RESIZER_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, RESIZER_PADS_NUM, pads);
        if (ret)
                return ret;
 
index a5e30413fc47ccc81c0999efe947b31f430c11ac..285dc1a69b2ca097860924291da78af3fe3cbf52 100644 (file)
@@ -1599,7 +1599,7 @@ int vpfe_video_init(struct vpfe_video_device *video, const char *name)
        spin_lock_init(&video->irqlock);
        spin_lock_init(&video->dma_queue_lock);
        mutex_init(&video->lock);
-       ret = media_entity_init(&video->video_dev.entity,
+       ret = media_entity_pads_init(&video->video_dev.entity,
                                1, &video->pad);
        if (ret < 0)
                return ret;
index 2b9a36cd8fa8eed5f43c4aa0603cbfb9d633704b..226366a036619d2ed09ddc0701bf998a0b4ec774 100644 (file)
@@ -1276,7 +1276,7 @@ static int csi2_init_entities(struct iss_csi2_device *csi2, const char *subname)
        pads[CSI2_PAD_SINK].flags = MEDIA_PAD_FL_SINK;
 
        me->ops = &csi2_media_ops;
-       ret = media_entity_init(me, CSI2_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, CSI2_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index dd9d7d54e6f86a2e6e7d757d91f9f7d8ec39f647..d38782e8e84c785503c5c28696222cd43950c971 100644 (file)
@@ -516,7 +516,7 @@ static int ipipe_init_entities(struct iss_ipipe_device *ipipe)
        pads[IPIPE_PAD_SOURCE_VP].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &ipipe_media_ops;
-       ret = media_entity_init(me, IPIPE_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, IPIPE_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index 8cbb9840a989cff7abb4f17c866baf7bdd3e6fdf..c2b5638a0898857aa0f0c35aba6d98130a2a484a 100644 (file)
@@ -748,7 +748,7 @@ static int ipipeif_init_entities(struct iss_ipipeif_device *ipipeif)
        pads[IPIPEIF_PAD_SOURCE_VP].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &ipipeif_media_ops;
-       ret = media_entity_init(me, IPIPEIF_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, IPIPEIF_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index a3925ecd0ed795a9a59b5544e7dd1a4a666cca62..fea13ab4041f6bea0326196b9b9053df51be2897 100644 (file)
@@ -790,7 +790,7 @@ static int resizer_init_entities(struct iss_resizer_device *resizer)
        pads[RESIZER_PAD_SOURCE_MEM].flags = MEDIA_PAD_FL_SOURCE;
 
        me->ops = &resizer_media_ops;
-       ret = media_entity_init(me, RESIZER_PADS_NUM, pads);
+       ret = media_entity_pads_init(me, RESIZER_PADS_NUM, pads);
        if (ret < 0)
                return ret;
 
index 60b7a58e6122deeb0bca7fd528654048f55282fe..8c6af412bc161cb98ec42dc20d73ff9ce6e74ac2 100644 (file)
@@ -1101,7 +1101,7 @@ int omap4iss_video_init(struct iss_video *video, const char *name)
                return -EINVAL;
        }
 
-       ret = media_entity_init(&video->video.entity, 1, &video->pad);
+       ret = media_entity_pads_init(&video->video.entity, 1, &video->pad);
        if (ret < 0)
                return ret;
 
index cd3f3a77df2d78280b7d810cd43237c3ba3ee279..32fef503d95066b71771052c1d29c841a5164347 100644 (file)
@@ -347,7 +347,7 @@ void media_gobj_init(struct media_device *mdev,
                    struct media_gobj *gobj);
 void media_gobj_remove(struct media_gobj *gobj);
 
-int media_entity_init(struct media_entity *entity, u16 num_pads,
+int media_entity_pads_init(struct media_entity *entity, u16 num_pads,
                      struct media_pad *pads);
 void media_entity_cleanup(struct media_entity *entity);