[media] media-entity.h: rename entity.type to entity.function
authorMauro Carvalho Chehab <mchehab@osg.samsung.com>
Sun, 6 Sep 2015 12:33:39 +0000 (09:33 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Mon, 11 Jan 2016 14:19:00 +0000 (12:19 -0200)
Entities should have one or more functions. Calling it as a
type proofed to not be correct, as an entity could eventually
have more than one type.

So, rename the field as function.

Please notice that this patch doesn't extend support for
multiple function entities. Such change will happen when
we have real case drivers using it.

No functional changes.

Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
28 files changed:
Documentation/video4linux/v4l2-framework.txt
drivers/media/dvb-core/dvbdev.c
drivers/media/dvb-frontends/au8522_decoder.c
drivers/media/i2c/adp1653.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/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/s5k6aa.c
drivers/media/i2c/smiapp/smiapp-core.c
drivers/media/media-device.c
drivers/media/platform/xilinx/xilinx-dma.c
drivers/media/usb/au0828/au0828-core.c
drivers/media/usb/au0828/au0828-video.c
drivers/media/usb/cx231xx/cx231xx-cards.c
drivers/media/usb/cx231xx/cx231xx-video.c
drivers/media/v4l2-core/tuner-core.c
drivers/media/v4l2-core/v4l2-dev.c
drivers/media/v4l2-core/v4l2-flash-led-class.c
drivers/media/v4l2-core/v4l2-subdev.c
include/media/media-entity.h

index 109cc37925344303caedb035fe76c1b063aee817..2e0fc28fa12feee5c9853395e63b383362e4d9d4 100644 (file)
@@ -303,8 +303,8 @@ calling media_entity_init():
        err = media_entity_init(&sd->entity, npads, pads);
 
 The pads array must have been previously initialized. There is no need to
-manually set the struct media_entity type and name fields, but the revision
-field must be initialized if needed.
+manually set the struct media_entity function and name fields, but the
+revision field must be initialized if needed.
 
 A reference to the entity will be automatically acquired/released when the
 subdev device node (if any) is opened/closed.
index bc650c637fc02dea22261fe15ed12d7465c6a2ef..f6fc95d1345b7b89aa8d02df0dbd0664f1dd3ee6 100644 (file)
@@ -242,7 +242,7 @@ static int dvb_create_tsout_entity(struct dvb_device *dvbdev,
                if (!entity->name)
                        return -ENOMEM;
 
-               entity->type = MEDIA_ENT_T_DVB_TSOUT;
+               entity->function = MEDIA_ENT_T_DVB_TSOUT;
                pads->flags = MEDIA_PAD_FL_SINK;
 
                ret = media_entity_init(entity, 1, pads);
@@ -315,18 +315,18 @@ static int dvb_create_media_entity(struct dvb_device *dvbdev,
 
        switch (type) {
        case DVB_DEVICE_FRONTEND:
-               dvbdev->entity->type = MEDIA_ENT_T_DVB_DEMOD;
+               dvbdev->entity->function = MEDIA_ENT_T_DVB_DEMOD;
                dvbdev->pads[0].flags = MEDIA_PAD_FL_SINK;
                dvbdev->pads[1].flags = MEDIA_PAD_FL_SOURCE;
                break;
        case DVB_DEVICE_DEMUX:
-               dvbdev->entity->type = MEDIA_ENT_T_DVB_DEMUX;
+               dvbdev->entity->function = MEDIA_ENT_T_DVB_DEMUX;
                dvbdev->pads[0].flags = MEDIA_PAD_FL_SINK;
                for (i = 1; i < npads; i++)
                        dvbdev->pads[i].flags = MEDIA_PAD_FL_SOURCE;
                break;
        case DVB_DEVICE_CA:
-               dvbdev->entity->type = MEDIA_ENT_T_DVB_CA;
+               dvbdev->entity->function = MEDIA_ENT_T_DVB_CA;
                dvbdev->pads[0].flags = MEDIA_PAD_FL_SINK;
                dvbdev->pads[1].flags = MEDIA_PAD_FL_SOURCE;
                break;
@@ -555,7 +555,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap)
                return 0;
 
        media_device_for_each_entity(entity, mdev) {
-               switch (entity->type) {
+               switch (entity->function) {
                case MEDIA_ENT_T_V4L2_SUBDEV_TUNER:
                        tuner = entity;
                        break;
@@ -594,7 +594,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap)
        /* Create demux links for each ringbuffer/pad */
        if (demux) {
                media_device_for_each_entity(entity, mdev) {
-                       if (entity->type == MEDIA_ENT_T_DVB_TSOUT) {
+                       if (entity->function == MEDIA_ENT_T_DVB_TSOUT) {
                                if (!strncmp(entity->name, DVR_TSOUT,
                                    strlen(DVR_TSOUT))) {
                                        ret = media_create_pad_link(demux,
@@ -639,7 +639,7 @@ int dvb_create_media_graph(struct dvb_adapter *adap)
                }
 
                media_device_for_each_entity(entity, mdev) {
-                       if (entity->type == MEDIA_ENT_T_DVB_TSOUT) {
+                       if (entity->function == MEDIA_ENT_T_DVB_TSOUT) {
                                if (!strcmp(entity->name, DVR_TSOUT)) {
                                        link = media_create_intf_link(entity,
                                                        intf,
index 580859c89da17608160aab74528b8ee687585ae7..664ec0dcd02ac47fdebfb3e3f42f376943e2e4d8 100644 (file)
@@ -766,7 +766,7 @@ static int au8522_probe(struct i2c_client *client,
        state->pads[AU8522_PAD_INPUT].flags = MEDIA_PAD_FL_SINK;
        state->pads[AU8522_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
        state->pads[AU8522_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
 
        ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
                                state->pads);
index 07e46b5b849cfb046e0becb32586523af6a755a3..9d99182cd1653fe7d5bbcbc84b6d969cbebaf78e 100644 (file)
@@ -516,7 +516,7 @@ static int adp1653_probe(struct i2c_client *client,
        if (ret < 0)
                goto free_and_quit;
 
-       flash->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
+       flash->subdev.entity.function = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
 
        return 0;
 
index b83c7fc988aef3d2cbd5b4cb8cc7389dc205de25..f45108c84f4d196136c108ac1879d894f8eafe4f 100644 (file)
@@ -831,7 +831,7 @@ static int as3645a_probe(struct i2c_client *client,
        if (ret < 0)
                goto done;
 
-       flash->subdev.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
+       flash->subdev.entity.function = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
 
        mutex_init(&flash->power_lock);
 
index 022ad5ae8869949e99aee054c69c64be3b1977dc..73bd05ee2fee60c2d5c6359ebf089a51efcd47cd 100644 (file)
@@ -5211,7 +5211,7 @@ static int cx25840_probe(struct i2c_client *client,
        state->pads[CX25840_PAD_INPUT].flags = MEDIA_PAD_FL_SINK;
        state->pads[CX25840_PAD_VID_OUT].flags = MEDIA_PAD_FL_SOURCE;
        state->pads[CX25840_PAD_VBI_OUT].flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
 
        ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
                                state->pads);
index 91c1ed27a458a08de21adf86041df6ea1a33579e..aa8b4832a1bc174827f4d0d9cdb33e197e7ecfff 100644 (file)
@@ -368,7 +368,7 @@ static int lm3560_subdev_init(struct lm3560_flash *flash,
        rval = media_entity_init(&flash->subdev_led[led_no].entity, 0, NULL);
        if (rval < 0)
                goto err_out;
-       flash->subdev_led[led_no].entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
+       flash->subdev_led[led_no].entity.function = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
 
        return rval;
 
index a037616bbab0e3efb98d3bf135319162bfb36832..a52cc3a6fb55802e9ae8c1533ef49b84998e6ab1 100644 (file)
@@ -285,7 +285,7 @@ static int lm3646_subdev_init(struct lm3646_flash *flash)
        rval = media_entity_init(&flash->subdev_led.entity, 0, NULL);
        if (rval < 0)
                goto err_out;
-       flash->subdev_led.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
+       flash->subdev_led.entity.function = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
        return rval;
 
 err_out:
index 0788c1908f9c0c5d824fab1b8eeb640606a145ea..ae5645fe3a6eda044d8493d5363e6c1b4793e689 100644 (file)
@@ -978,7 +978,7 @@ static int m5mols_probe(struct i2c_client *client,
        ret = media_entity_init(&sd->entity, 1, &info->pad);
        if (ret < 0)
                return ret;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
 
        init_waitqueue_head(&info->irq_waitq);
        mutex_init(&info->lock);
index 2e614ad473f1f08db7d85cb5092d7771420c6732..0226fc6685291b1ef4b7fee087cd977e1289a24e 100644 (file)
@@ -779,7 +779,7 @@ static int noon010_probe(struct i2c_client *client,
                goto np_err;
 
        info->pad.flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
        ret = media_entity_init(&sd->entity, 1, &info->pad);
        if (ret < 0)
                goto np_err;
index ea95f854a51959aebb74c9c4f3dc96f198c6193c..8a2efe2a24c4976f9d06fbae98cc8d1824704122 100644 (file)
@@ -1445,7 +1445,7 @@ static int ov2659_probe(struct i2c_client *client,
 
 #if defined(CONFIG_MEDIA_CONTROLLER)
        ov2659->pad.flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
        ret = media_entity_init(&sd->entity, 1, &ov2659->pad);
        if (ret < 0) {
                v4l2_ctrl_handler_free(&ov2659->ctrls);
index b4c408f2a2b0d81117124fd5058ad2707c2d9de9..27c4def7e4fcd0cfc51b9c74d15fc09e7932417e 100644 (file)
@@ -1500,7 +1500,7 @@ static int ov965x_probe(struct i2c_client *client,
                return ret;
 
        ov965x->pad.flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
        ret = media_entity_init(&sd->entity, 1, &ov965x->pad);
        if (ret < 0)
                return ret;
index ee7404ee665973e1844fe002df5ae7482e068259..dd48e35ede28074f465ce4ac3c32c7e3258e655a 100644 (file)
@@ -1688,7 +1688,7 @@ static int s5c73m3_probe(struct i2c_client *client,
 
        state->sensor_pads[S5C73M3_JPEG_PAD].flags = MEDIA_PAD_FL_SOURCE;
        state->sensor_pads[S5C73M3_ISP_PAD].flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
 
        ret = media_entity_init(&sd->entity, S5C73M3_NUM_PADS,
                                                        state->sensor_pads);
@@ -1704,7 +1704,7 @@ static int s5c73m3_probe(struct i2c_client *client,
        state->oif_pads[OIF_ISP_PAD].flags = MEDIA_PAD_FL_SINK;
        state->oif_pads[OIF_JPEG_PAD].flags = MEDIA_PAD_FL_SINK;
        state->oif_pads[OIF_SOURCE_PAD].flags = MEDIA_PAD_FL_SOURCE;
-       oif_sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
+       oif_sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
 
        ret = media_entity_init(&oif_sd->entity, OIF_NUM_PADS,
                                                        state->oif_pads);
index 445a89e30949df2b23714d86d29df0b8c90e658c..026d0874053737f610d12c196be5b1f9e3899067 100644 (file)
@@ -961,7 +961,7 @@ static int s5k4ecgx_probe(struct i2c_client *client,
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        priv->pad.flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
        ret = media_entity_init(&sd->entity, 1, &priv->pad);
        if (ret)
                return ret;
index 3e929858d5be1efcad892f4243d561ce89da20af..1d47b30953a482e1ee9c2b46a1013ec9b4ef2046 100644 (file)
@@ -408,7 +408,7 @@ static inline struct v4l2_subdev *ctrl_to_sd(struct v4l2_ctrl *ctrl)
 
 static inline bool s5k5baf_is_cis_subdev(struct v4l2_subdev *sd)
 {
-       return sd->entity.type == MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       return sd->entity.function == MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
 }
 
 static inline struct s5k5baf *to_s5k5baf(struct v4l2_subdev *sd)
@@ -1904,7 +1904,7 @@ static int s5k5baf_configure_subdevs(struct s5k5baf *state,
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        state->cis_pad.flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
        ret = media_entity_init(&sd->entity, NUM_CIS_PADS, &state->cis_pad);
        if (ret < 0)
                goto err;
@@ -1919,7 +1919,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.type = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
        ret = media_entity_init(&sd->entity, NUM_ISP_PADS, state->pads);
 
        if (!ret)
index 31be29d250932df9d6392712c421dc3b0e80025d..d7244234473e9fcd3ed510a1707296b205b08c13 100644 (file)
@@ -1577,7 +1577,7 @@ static int s5k6aa_probe(struct i2c_client *client,
        sd->flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
 
        s5k6aa->pad.flags = MEDIA_PAD_FL_SOURCE;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
        ret = media_entity_init(&sd->entity, 1, &s5k6aa->pad);
        if (ret)
                return ret;
index df4f8824c344bac4028019b44f9ebc70a294f7d5..ef325b653697f51cb6849d884e60772662a4ee9b 100644 (file)
@@ -2763,7 +2763,7 @@ static int smiapp_init(struct smiapp_sensor *sensor)
 
        dev_dbg(&client->dev, "profile %d\n", sensor->minfo.smiapp_profile);
 
-       sensor->pixel_array->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
+       sensor->pixel_array->sd.entity.function = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
 
        /* final steps */
        smiapp_read_frame_fmt(sensor);
index 30cef8740afaaa7106c89b2f91887783aa0d3a5a..4f8388423edcec518d2cf58b910e905567356c56 100644 (file)
@@ -108,7 +108,7 @@ static long media_device_enum_entities(struct media_device *mdev,
        u_ent.id = media_entity_id(ent);
        if (ent->name)
                strlcpy(u_ent.name, ent->name, sizeof(u_ent.name));
-       u_ent.type = ent->type;
+       u_ent.type = ent->function;
        u_ent.revision = ent->revision;
        u_ent.flags = ent->flags;
        u_ent.group_id = ent->group_id;
@@ -610,8 +610,8 @@ int __must_check media_device_register_entity(struct media_device *mdev,
 {
        int i;
 
-       if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN ||
-           entity->type == MEDIA_ENT_T_UNKNOWN)
+       if (entity->function == MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN ||
+           entity->function == MEDIA_ENT_T_UNKNOWN)
                dev_warn(mdev->dev,
                         "Entity type for entity %s was not initialized!\n",
                         entity->name);
index b3fb1570b1892d6e476c2e4aeb57d481863eceef..1f0043f3ec4dd820cd1a0c66be92c7665064b0a5 100644 (file)
@@ -191,7 +191,7 @@ static int xvip_pipeline_validate(struct xvip_pipeline *pipe,
        while ((entity = media_entity_graph_walk_next(&graph))) {
                struct xvip_dma *dma;
 
-               if (entity->type != MEDIA_ENT_T_V4L2_VIDEO)
+               if (entity->function != MEDIA_ENT_T_V4L2_VIDEO)
                        continue;
 
                dma = to_xvip_dma(media_entity_to_video_device(entity));
index 27679e5cdca1adf3d76b192f0c0f44dae5850aa4..865d68dc4dc89ccc1c00993cdb6cc16b9cc93049 100644 (file)
@@ -265,7 +265,7 @@ static int au0828_create_media_graph(struct au0828_dev *dev)
                return 0;
 
        media_device_for_each_entity(entity, mdev) {
-               switch (entity->type) {
+               switch (entity->function) {
                case MEDIA_ENT_T_V4L2_SUBDEV_TUNER:
                        tuner = entity;
                        break;
index 75f2e02908f472c9556fec52507c566aea95ff2a..066ba4b7c746e0979c9fb8cb80db6113b47a5825 100644 (file)
@@ -1832,18 +1832,18 @@ static void au0828_analog_create_entities(struct au0828_dev *dev)
 
                switch (AUVI_INPUT(i).type) {
                case AU0828_VMUX_COMPOSITE:
-                       ent->type = MEDIA_ENT_T_CONN_COMPOSITE;
+                       ent->function = MEDIA_ENT_T_CONN_COMPOSITE;
                        break;
                case AU0828_VMUX_SVIDEO:
-                       ent->type = MEDIA_ENT_T_CONN_SVIDEO;
+                       ent->function = MEDIA_ENT_T_CONN_SVIDEO;
                        break;
                case AU0828_VMUX_CABLE:
                case AU0828_VMUX_TELEVISION:
                case AU0828_VMUX_DVB:
-                       ent->type = MEDIA_ENT_T_CONN_RF;
+                       ent->function = MEDIA_ENT_T_CONN_RF;
                        break;
                default: /* AU0828_VMUX_DEBUG */
-                       ent->type = MEDIA_ENT_T_CONN_TEST;
+                       ent->function = MEDIA_ENT_T_CONN_TEST;
                        break;
                }
 
index b842bfc799ccb8dff86879704007d54dcba9035f..5062c42a694c2ec6732c97ee4b88e38ec82d7602 100644 (file)
@@ -1249,7 +1249,7 @@ static int cx231xx_create_media_graph(struct cx231xx *dev)
                return 0;
 
        media_device_for_each_entity(entity, mdev) {
-               switch (entity->type) {
+               switch (entity->function) {
                case MEDIA_ENT_T_V4L2_SUBDEV_TUNER:
                        tuner = entity;
                        break;
index b5eb9f61387257a6950024024d8a85994a5b6eb0..110359deab37fcad941acfffa1cc624d88797249 100644 (file)
@@ -119,7 +119,7 @@ static int cx231xx_enable_analog_tuner(struct cx231xx *dev)
         * this should be enough for the actual needs.
         */
        media_device_for_each_entity(entity, mdev) {
-               if (entity->type == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
+               if (entity->function == MEDIA_ENT_T_V4L2_SUBDEV_DECODER) {
                        decoder = entity;
                        break;
                }
index b90f2a52db9631a7218c2290a1ec6f835bf67ada..e8fc5ec8fc353ea6d19fefad897ad99683e116a3 100644 (file)
@@ -698,7 +698,7 @@ register_client:
 #if defined(CONFIG_MEDIA_CONTROLLER)
        t->pad[TUNER_PAD_RF_INPUT].flags = MEDIA_PAD_FL_SINK;
        t->pad[TUNER_PAD_IF_OUTPUT].flags = MEDIA_PAD_FL_SOURCE;
-       t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
+       t->sd.entity.function = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
        t->sd.entity.name = t->name;
 
        ret = media_entity_init(&t->sd.entity, TUNER_NUM_PADS, &t->pad[0]);
index d36436582de96b409be0f6f034c7f3e0dc74b6ea..965449958e97039a794b0129297fd7e2ca909cd8 100644 (file)
@@ -197,7 +197,7 @@ static void v4l2_device_release(struct device *cd)
        if (v4l2_dev->mdev) {
                /* Remove interfaces and interface links */
                media_devnode_remove(vdev->intf_devnode);
-               if (vdev->entity.type != MEDIA_ENT_T_UNKNOWN)
+               if (vdev->entity.function != MEDIA_ENT_T_UNKNOWN)
                        media_device_unregister_entity(&vdev->entity);
        }
 #endif
@@ -735,20 +735,20 @@ static int video_register_media_controller(struct video_device *vdev, int type)
        if (!vdev->v4l2_dev->mdev)
                return 0;
 
-       vdev->entity.type = MEDIA_ENT_T_UNKNOWN;
+       vdev->entity.function = MEDIA_ENT_T_UNKNOWN;
 
        switch (type) {
        case VFL_TYPE_GRABBER:
                intf_type = MEDIA_INTF_T_V4L_VIDEO;
-               vdev->entity.type = MEDIA_ENT_T_V4L2_VIDEO;
+               vdev->entity.function = MEDIA_ENT_T_V4L2_VIDEO;
                break;
        case VFL_TYPE_VBI:
                intf_type = MEDIA_INTF_T_V4L_VBI;
-               vdev->entity.type = MEDIA_ENT_T_V4L2_VBI;
+               vdev->entity.function = MEDIA_ENT_T_V4L2_VBI;
                break;
        case VFL_TYPE_SDR:
                intf_type = MEDIA_INTF_T_V4L_SWRADIO;
-               vdev->entity.type = MEDIA_ENT_T_V4L2_SWRADIO;
+               vdev->entity.function = MEDIA_ENT_T_V4L2_SWRADIO;
                break;
        case VFL_TYPE_RADIO:
                intf_type = MEDIA_INTF_T_V4L_RADIO;
@@ -766,7 +766,7 @@ static int video_register_media_controller(struct video_device *vdev, int type)
                return 0;
        }
 
-       if (vdev->entity.type != MEDIA_ENT_T_UNKNOWN) {
+       if (vdev->entity.function != MEDIA_ENT_T_UNKNOWN) {
                vdev->entity.name = vdev->name;
 
                /* Needed just for backward compatibility with legacy MC API */
@@ -793,7 +793,7 @@ static int video_register_media_controller(struct video_device *vdev, int type)
                return -ENOMEM;
        }
 
-       if (vdev->entity.type != MEDIA_ENT_T_UNKNOWN) {
+       if (vdev->entity.function != MEDIA_ENT_T_UNKNOWN) {
                struct media_link *link;
 
                link = media_create_intf_link(&vdev->entity,
index 34c489fed55e76de1419664d448446580783ed2f..cf7b3cb9a37368e1b99f7de8f15d6d0dc78461db 100644 (file)
@@ -655,7 +655,7 @@ struct v4l2_flash *v4l2_flash_init(
        if (ret < 0)
                return ERR_PTR(ret);
 
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_FLASH;
 
        ret = v4l2_flash_init_controls(v4l2_flash, config);
        if (ret < 0)
index b3bcc8253182b6bb99d693a646fc3d825cbc0b4f..b440cb66669c704de62f15e276230ac073f31237 100644 (file)
@@ -535,9 +535,9 @@ v4l2_subdev_link_validate_get_format(struct media_pad *pad,
                return v4l2_subdev_call(sd, pad, get_fmt, NULL, fmt);
        }
 
-       WARN(pad->entity->type != MEDIA_ENT_T_V4L2_VIDEO,
+       WARN(pad->entity->function != MEDIA_ENT_T_V4L2_VIDEO,
             "Driver bug! Wrong media entity type 0x%08x, entity %s\n",
-            pad->entity->type, pad->entity->name);
+            pad->entity->function, pad->entity->name);
 
        return -EINVAL;
 }
@@ -584,7 +584,7 @@ void v4l2_subdev_init(struct v4l2_subdev *sd, const struct v4l2_subdev_ops *ops)
        sd->host_priv = NULL;
 #if defined(CONFIG_MEDIA_CONTROLLER)
        sd->entity.name = sd->name;
-       sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
+       sd->entity.function = MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN;
 #endif
 }
 EXPORT_SYMBOL(v4l2_subdev_init);
index 0c7390d2edaed445935655cb028a778b372c3b79..70ccd6cf14c1a41be5cf0a0db95e65aa5155bbfd 100644 (file)
@@ -152,7 +152,8 @@ struct media_entity_operations {
  *
  * @graph_obj: Embedded structure containing the media object common data.
  * @name:      Entity name.
- * @type:      Entity type, as defined in uapi/media.h (MEDIA_ENT_T_*)
+ * @function:  Entity main function, as defined in uapi/media.h
+ *             (MEDIA_ENT_F_*)
  * @revision:  Entity revision - OBSOLETE - should be removed soon.
  * @flags:     Entity flags, as defined in uapi/media.h (MEDIA_ENT_FL_*)
  * @group_id:  Entity group ID - OBSOLETE - should be removed soon.
@@ -179,7 +180,7 @@ struct media_entity_operations {
 struct media_entity {
        struct media_gobj graph_obj;    /* must be first field in struct */
        const char *name;
-       u32 type;
+       u32 function;
        u32 revision;
        unsigned long flags;
        u32 group_id;
@@ -272,7 +273,7 @@ static inline bool is_media_entity_v4l2_io(struct media_entity *entity)
        if (!entity)
                return false;
 
-       switch (entity->type) {
+       switch (entity->function) {
        case MEDIA_ENT_T_V4L2_VIDEO:
        case MEDIA_ENT_T_V4L2_VBI:
        case MEDIA_ENT_T_V4L2_SWRADIO:
@@ -287,7 +288,7 @@ static inline bool is_media_entity_v4l2_subdev(struct media_entity *entity)
        if (!entity)
                return false;
 
-       switch (entity->type) {
+       switch (entity->function) {
        case MEDIA_ENT_T_V4L2_SUBDEV_UNKNOWN:
        case MEDIA_ENT_T_V4L2_SUBDEV_SENSOR:
        case MEDIA_ENT_T_V4L2_SUBDEV_FLASH: