Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0e576b76 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab
Browse files

[media] media-entity.h: rename entity.type to entity.function



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: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 77328043
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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.
+7 −7
Original line number Diff line number Diff line
@@ -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,
+1 −1
Original line number Diff line number Diff line
@@ -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);
+1 −1
Original line number Diff line number Diff line
@@ -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;

+1 −1
Original line number Diff line number Diff line
@@ -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);

Loading