mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-11-25 13:30:57 +07:00
[media] media: get rid of unused "extra_links" param on media_entity_init()
Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
This commit is contained in:
parent
0158e7b6a2
commit
1809510715
@ -104,7 +104,7 @@ although drivers can allocate entities directly.
|
||||
Drivers initialize entities by calling
|
||||
|
||||
media_entity_init(struct media_entity *entity, u16 num_pads,
|
||||
struct media_pad *pads, u16 extra_links);
|
||||
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
|
||||
@ -120,9 +120,8 @@ media_entity_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
|
||||
pre-allocates a number of links equal to the number of pads plus an optional
|
||||
number of extra links. The links array will be reallocated if it grows beyond
|
||||
the initial estimate.
|
||||
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.
|
||||
|
||||
Drivers register entities with a media device by calling
|
||||
|
||||
|
@ -300,7 +300,7 @@ calling media_entity_init():
|
||||
struct media_pad *pads = &my_sd->pads;
|
||||
int err;
|
||||
|
||||
err = media_entity_init(&sd->entity, npads, pads, 0);
|
||||
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
|
||||
@ -700,7 +700,7 @@ calling media_entity_init():
|
||||
struct media_pad *pad = &my_vdev->pad;
|
||||
int err;
|
||||
|
||||
err = media_entity_init(&vdev->entity, 1, pad, 0);
|
||||
err = media_entity_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.
|
||||
|
@ -295,7 +295,7 @@ owner 域。若使用 i2c 辅助函数,这些都会帮你处理好。
|
||||
struct media_pad *pads = &my_sd->pads;
|
||||
int err;
|
||||
|
||||
err = media_entity_init(&sd->entity, npads, pads, 0);
|
||||
err = media_entity_init(&sd->entity, npads, pads);
|
||||
|
||||
pads 数组必须预先初始化。无须手动设置 media_entity 的 type 和
|
||||
name 域,但如有必要,revision 域必须初始化。
|
||||
@ -602,7 +602,7 @@ v4l2_file_operations 结构体是 file_operations 的一个子集。其主要
|
||||
struct media_pad *pad = &my_vdev->pad;
|
||||
int err;
|
||||
|
||||
err = media_entity_init(&vdev->entity, 1, pad, 0);
|
||||
err = media_entity_init(&vdev->entity, 1, pad);
|
||||
|
||||
pads 数组必须预先初始化。没有必要手动设置 media_entity 的 type 和
|
||||
name 域。
|
||||
|
@ -249,7 +249,7 @@ static void dvb_register_media_device(struct dvb_device *dvbdev,
|
||||
}
|
||||
|
||||
if (npads)
|
||||
ret = media_entity_init(dvbdev->entity, npads, dvbdev->pads, 0);
|
||||
ret = media_entity_init(dvbdev->entity, npads, dvbdev->pads);
|
||||
if (!ret)
|
||||
ret = media_device_register_entity(dvbdev->adapter->mdev,
|
||||
dvbdev->entity);
|
||||
|
@ -769,7 +769,7 @@ static int au8522_probe(struct i2c_client *client,
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
|
||||
|
||||
ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
|
||||
state->pads, 0);
|
||||
state->pads);
|
||||
if (ret < 0) {
|
||||
v4l_info(client, "failed to initialize media entity!\n");
|
||||
return ret;
|
||||
|
@ -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, 0);
|
||||
err = media_entity_init(&sd->entity, 1, &state->pad);
|
||||
if (err)
|
||||
goto err_hdl;
|
||||
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&flash->subdev.entity, 0, NULL);
|
||||
if (ret < 0)
|
||||
goto free_and_quit;
|
||||
|
||||
|
@ -1214,7 +1214,7 @@ static int adv7180_probe(struct i2c_client *client,
|
||||
|
||||
state->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.flags |= MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
|
||||
ret = media_entity_init(&sd->entity, 1, &state->pad, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &state->pad);
|
||||
if (ret)
|
||||
goto err_free_ctrl;
|
||||
|
||||
|
@ -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, 0);
|
||||
err = media_entity_init(&sd->entity, 1, &state->pad);
|
||||
if (err)
|
||||
goto err_hdl;
|
||||
|
||||
|
@ -3209,7 +3209,7 @@ static int adv76xx_probe(struct i2c_client *client,
|
||||
state->pads[state->source_pad].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
err = media_entity_init(&sd->entity, state->source_pad + 1,
|
||||
state->pads, 0);
|
||||
state->pads);
|
||||
if (err)
|
||||
goto err_work_queues;
|
||||
|
||||
|
@ -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, 0);
|
||||
err = media_entity_init(&sd->entity, 1, &state->pad);
|
||||
if (err)
|
||||
goto err_work_queues;
|
||||
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&flash->subdev.entity, 0, NULL);
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
||||
|
@ -5214,7 +5214,7 @@ static int cx25840_probe(struct i2c_client *client,
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_DECODER;
|
||||
|
||||
ret = media_entity_init(&sd->entity, ARRAY_SIZE(state->pads),
|
||||
state->pads, 0);
|
||||
state->pads);
|
||||
if (ret < 0) {
|
||||
v4l_info(client, "failed to initialize media entity!\n");
|
||||
return ret;
|
||||
|
@ -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, 0);
|
||||
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;
|
||||
|
@ -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, 0);
|
||||
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;
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &info->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&sensor->subdev.entity, 1, &sensor->pad);
|
||||
if (ret < 0)
|
||||
goto error_ctrl;
|
||||
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&mt9p031->subdev.entity, 1, &mt9p031->pad);
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&mt9t001->subdev.entity, 1, &mt9t001->pad);
|
||||
|
||||
done:
|
||||
if (ret < 0) {
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&mt9v032->subdev.entity, 1, &mt9v032->pad);
|
||||
if (ret < 0)
|
||||
goto err;
|
||||
|
||||
|
@ -780,7 +780,7 @@ static int noon010_probe(struct i2c_client *client,
|
||||
|
||||
info->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
ret = media_entity_init(&sd->entity, 1, &info->pad, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &info->pad);
|
||||
if (ret < 0)
|
||||
goto np_err;
|
||||
|
||||
|
@ -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.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
ret = media_entity_init(&sd->entity, 1, &ov2659->pad, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &ov2659->pad);
|
||||
if (ret < 0) {
|
||||
v4l2_ctrl_handler_free(&ov2659->ctrls);
|
||||
return ret;
|
||||
|
@ -1501,7 +1501,7 @@ static int ov965x_probe(struct i2c_client *client,
|
||||
|
||||
ov965x->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
ret = media_entity_init(&sd->entity, 1, &ov965x->pad, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &ov965x->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1691,7 +1691,7 @@ static int s5c73m3_probe(struct i2c_client *client,
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
|
||||
|
||||
ret = media_entity_init(&sd->entity, S5C73M3_NUM_PADS,
|
||||
state->sensor_pads, 0);
|
||||
state->sensor_pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -1707,7 +1707,7 @@ static int s5c73m3_probe(struct i2c_client *client,
|
||||
oif_sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV;
|
||||
|
||||
ret = media_entity_init(&oif_sd->entity, OIF_NUM_PADS,
|
||||
state->oif_pads, 0);
|
||||
state->oif_pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -962,7 +962,7 @@ static int s5k4ecgx_probe(struct i2c_client *client,
|
||||
|
||||
priv->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
ret = media_entity_init(&sd->entity, 1, &priv->pad, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &priv->pad);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -1905,7 +1905,7 @@ static int s5k5baf_configure_subdevs(struct s5k5baf *state,
|
||||
|
||||
state->cis_pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
ret = media_entity_init(&sd->entity, NUM_CIS_PADS, &state->cis_pad, 0);
|
||||
ret = media_entity_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.type = MEDIA_ENT_T_V4L2_SUBDEV;
|
||||
ret = media_entity_init(&sd->entity, NUM_ISP_PADS, state->pads, 0);
|
||||
ret = media_entity_init(&sd->entity, NUM_ISP_PADS, state->pads);
|
||||
|
||||
if (!ret)
|
||||
return 0;
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &sensor->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1578,7 +1578,7 @@ static int s5k6aa_probe(struct i2c_client *client,
|
||||
|
||||
s5k6aa->pad.flags = MEDIA_PAD_FL_SOURCE;
|
||||
sd->entity.type = MEDIA_ENT_T_V4L2_SUBDEV_SENSOR;
|
||||
ret = media_entity_init(&sd->entity, 1, &s5k6aa->pad, 0);
|
||||
ret = media_entity_init(&sd->entity, 1, &s5k6aa->pad);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -2488,7 +2488,7 @@ static int smiapp_register_subdevs(struct smiapp_sensor *sensor)
|
||||
continue;
|
||||
|
||||
rval = media_entity_init(&this->sd.entity,
|
||||
this->npads, this->pads, 0);
|
||||
this->npads, this->pads);
|
||||
if (rval) {
|
||||
dev_err(&client->dev,
|
||||
"media_entity_init failed\n");
|
||||
@ -3078,7 +3078,7 @@ static int smiapp_probe(struct i2c_client *client,
|
||||
|
||||
sensor->src->pads[0].flags = MEDIA_PAD_FL_SOURCE;
|
||||
rval = media_entity_init(&sensor->src->sd.entity, 2,
|
||||
sensor->src->pads, 0);
|
||||
sensor->src->pads);
|
||||
if (rval < 0)
|
||||
return rval;
|
||||
|
||||
|
@ -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, 0);
|
||||
err = media_entity_init(&sd->entity, 1, &state->pad);
|
||||
if (err < 0)
|
||||
goto err_hdl;
|
||||
|
||||
|
@ -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_T_V4L2_SUBDEV_DECODER;
|
||||
|
||||
ret = media_entity_init(&decoder->sd.entity, 1, &decoder->pad, 0);
|
||||
ret = media_entity_init(&decoder->sd.entity, 1, &decoder->pad);
|
||||
if (ret < 0) {
|
||||
v4l2_err(sd, "%s decoder driver failed to register !!\n",
|
||||
sd->name);
|
||||
|
@ -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_T_V4L2_SUBDEV_DECODER;
|
||||
|
||||
error = media_entity_init(&device->sd.entity, 1, &device->pad, 0);
|
||||
error = media_entity_init(&device->sd.entity, 1, &device->pad);
|
||||
if (error < 0)
|
||||
return error;
|
||||
#endif
|
||||
|
@ -30,32 +30,30 @@
|
||||
* media_entity_init - Initialize a media entity
|
||||
*
|
||||
* @num_pads: Total number of sink and source pads.
|
||||
* @extra_links: Initial estimate of the number of extra links.
|
||||
* @pads: Array of 'num_pads' pads.
|
||||
*
|
||||
* The total number of pads is an intrinsic property of entities known by the
|
||||
* entity driver, while the total number of links depends on hardware design
|
||||
* and is an extrinsic property unknown to the entity driver. However, in most
|
||||
* use cases the entity driver can guess the number of links which can safely
|
||||
* be assumed to be equal to or larger than the number of pads.
|
||||
* use cases the number of links can safely be assumed to be equal to or
|
||||
* larger than the number of pads.
|
||||
*
|
||||
* For those reasons the links array can be preallocated based on the entity
|
||||
* driver guess and will be reallocated later if extra links need to be
|
||||
* created.
|
||||
* For those reasons the links array can be preallocated based on the number
|
||||
* of pads and will be reallocated later if extra links need to be created.
|
||||
*
|
||||
* This function allocates a links array with enough space to hold at least
|
||||
* 'num_pads' + 'extra_links' elements. The media_entity::max_links field will
|
||||
* be set to the number of allocated elements.
|
||||
* 'num_pads' elements. The media_entity::max_links field will be set to the
|
||||
* 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.
|
||||
*/
|
||||
int
|
||||
media_entity_init(struct media_entity *entity, u16 num_pads,
|
||||
struct media_pad *pads, u16 extra_links)
|
||||
struct media_pad *pads)
|
||||
{
|
||||
struct media_link *links;
|
||||
unsigned int max_links = num_pads + extra_links;
|
||||
unsigned int max_links = num_pads;
|
||||
unsigned int i;
|
||||
|
||||
links = kzalloc(max_links * sizeof(links[0]), GFP_KERNEL);
|
||||
|
@ -1800,7 +1800,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, 0);
|
||||
ret = media_entity_init(&vfd->entity, 1, &vid_cap->vd_pad);
|
||||
if (ret)
|
||||
goto err_free_ctx;
|
||||
|
||||
@ -1893,7 +1893,7 @@ int fimc_initialize_capture_subdev(struct fimc_dev *fimc)
|
||||
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,
|
||||
fimc->vid_cap.sd_pads, 0);
|
||||
fimc->vid_cap.sd_pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -617,7 +617,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, 0);
|
||||
ret = media_entity_init(&vdev->entity, 1, &iv->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -709,7 +709,7 @@ int fimc_isp_subdev_create(struct fimc_isp *isp)
|
||||
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,
|
||||
isp->subdev_pads, 0);
|
||||
isp->subdev_pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -1316,7 +1316,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, 0);
|
||||
ret = media_entity_init(&vfd->entity, 1, &fimc->vd_pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
@ -1431,7 +1431,7 @@ static int fimc_lite_create_capture_subdev(struct fimc_lite *fimc)
|
||||
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,
|
||||
fimc->subdev_pads, 0);
|
||||
fimc->subdev_pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&vfd->entity, 0, NULL);
|
||||
if (ret)
|
||||
goto err_me;
|
||||
|
||||
|
@ -867,7 +867,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,
|
||||
CSIS_PADS_NUM, state->pads, 0);
|
||||
CSIS_PADS_NUM, state->pads);
|
||||
if (ret < 0)
|
||||
goto e_clkdis;
|
||||
|
||||
|
@ -2650,7 +2650,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, 0);
|
||||
ret = media_entity_init(me, CCDC_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1071,7 +1071,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, 0);
|
||||
ret = media_entity_init(me, CCP2_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1245,7 +1245,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, 0);
|
||||
ret = media_entity_init(me, CSI2_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -2282,7 +2282,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, 0);
|
||||
ret = media_entity_init(me, PREV_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1728,7 +1728,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, 0);
|
||||
ret = media_entity_init(me, RESZ_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -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, 0);
|
||||
return media_entity_init(me, 1, &stat->pad);
|
||||
}
|
||||
|
||||
int omap3isp_stat_init(struct ispstat *stat, const char *name,
|
||||
|
@ -1367,7 +1367,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, 0);
|
||||
ret = media_entity_init(&video->video.entity, 1, &video->pad);
|
||||
if (ret < 0) {
|
||||
vb2_dma_contig_cleanup_ctx(video->alloc_ctx);
|
||||
return ret;
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&vfd->entity, 1, &vp->pad);
|
||||
if (ret)
|
||||
goto err_vd_rel;
|
||||
|
||||
@ -1560,7 +1560,7 @@ int s3c_camif_create_subdev(struct camif_dev *camif)
|
||||
camif->pads[CAMIF_SD_PAD_SOURCE_P].flags = MEDIA_PAD_FL_SOURCE;
|
||||
|
||||
ret = media_entity_init(&sd->entity, CAMIF_SD_PADS_NUM,
|
||||
camif->pads, 0);
|
||||
camif->pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -220,7 +220,7 @@ int vsp1_entity_init(struct vsp1_device *vsp1, struct vsp1_entity *entity,
|
||||
|
||||
/* Initialize the media entity. */
|
||||
return media_entity_init(&entity->subdev.entity, num_pads,
|
||||
entity->pads, 0);
|
||||
entity->pads);
|
||||
}
|
||||
|
||||
void vsp1_entity_destroy(struct vsp1_entity *entity)
|
||||
|
@ -1193,7 +1193,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, 0);
|
||||
ret = media_entity_init(&video->video.entity, 1, &video->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -677,7 +677,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, 0);
|
||||
ret = media_entity_init(&dma->video.entity, 1, &dma->pad);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&subdev->entity, xtpg->npads, xtpg->pads);
|
||||
if (ret < 0)
|
||||
goto error;
|
||||
|
||||
|
@ -1887,12 +1887,12 @@ int au0828_analog_register(struct au0828_dev *dev,
|
||||
|
||||
#if defined(CONFIG_MEDIA_CONTROLLER)
|
||||
dev->video_pad.flags = MEDIA_PAD_FL_SINK;
|
||||
ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad, 0);
|
||||
ret = media_entity_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, 0);
|
||||
ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
|
||||
if (ret < 0)
|
||||
pr_err("failed to initialize vbi media entity!\n");
|
||||
#endif
|
||||
|
@ -2177,7 +2177,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, 0);
|
||||
ret = media_entity_init(&dev->vdev.entity, 1, &dev->video_pad);
|
||||
if (ret < 0)
|
||||
dev_err(dev->dev, "failed to initialize video media entity!\n");
|
||||
#endif
|
||||
@ -2204,7 +2204,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, 0);
|
||||
ret = media_entity_init(&dev->vbi_dev.entity, 1, &dev->vbi_pad);
|
||||
if (ret < 0)
|
||||
dev_err(dev->dev, "failed to initialize vbi media entity!\n");
|
||||
#endif
|
||||
|
@ -89,10 +89,10 @@ static int uvc_mc_init_entity(struct uvc_entity *entity)
|
||||
sizeof(entity->subdev.name));
|
||||
|
||||
ret = media_entity_init(&entity->subdev.entity,
|
||||
entity->num_pads, entity->pads, 0);
|
||||
entity->num_pads, entity->pads);
|
||||
} else if (entity->vdev != NULL) {
|
||||
ret = media_entity_init(&entity->vdev->entity,
|
||||
entity->num_pads, entity->pads, 0);
|
||||
entity->num_pads, entity->pads);
|
||||
if (entity->flags & UVC_ENTITY_FLAG_DEFAULT)
|
||||
entity->vdev->entity.flags |= MEDIA_ENT_FL_DEFAULT;
|
||||
} else
|
||||
|
@ -699,7 +699,7 @@ static int tuner_probe(struct i2c_client *client,
|
||||
t->sd.entity.type = MEDIA_ENT_T_V4L2_SUBDEV_TUNER;
|
||||
t->sd.entity.name = t->name;
|
||||
|
||||
ret = media_entity_init(&t->sd.entity, 1, &t->pad, 0);
|
||||
ret = media_entity_init(&t->sd.entity, 1, &t->pad);
|
||||
if (ret < 0) {
|
||||
tuner_err("failed to initialize media entity!\n");
|
||||
kfree(t);
|
||||
|
@ -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, 0);
|
||||
ret = media_entity_init(&sd->entity, 0, NULL);
|
||||
if (ret < 0)
|
||||
return ERR_PTR(ret);
|
||||
|
||||
|
@ -1840,7 +1840,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, 0);
|
||||
return media_entity_init(me, IPIPE_PADS_NUM, pads);
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -1026,7 +1026,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, 0);
|
||||
ret = media_entity_init(me, IPIPEIF_NUM_PADS, pads);
|
||||
if (ret)
|
||||
goto fail;
|
||||
|
||||
|
@ -2052,7 +2052,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, 0);
|
||||
status = media_entity_init(me, ISIF_PADS_NUM, pads);
|
||||
if (status)
|
||||
goto isif_fail;
|
||||
isif->video_out.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
|
||||
|
@ -1910,7 +1910,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, 0);
|
||||
ret = media_entity_init(me, RESIZER_CROP_PADS_NUM, pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -1932,7 +1932,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, 0);
|
||||
ret = media_entity_init(me, RESIZER_PADS_NUM, pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
@ -1954,7 +1954,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, 0);
|
||||
ret = media_entity_init(me, RESIZER_PADS_NUM, pads);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
@ -1601,7 +1601,7 @@ int vpfe_video_init(struct vpfe_video_device *video, const char *name)
|
||||
spin_lock_init(&video->dma_queue_lock);
|
||||
mutex_init(&video->lock);
|
||||
ret = media_entity_init(&video->video_dev.entity,
|
||||
1, &video->pad, 0);
|
||||
1, &video->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1271,7 +1271,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, 0);
|
||||
ret = media_entity_init(me, CSI2_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -513,7 +513,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, 0);
|
||||
ret = media_entity_init(me, IPIPE_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -743,7 +743,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, 0);
|
||||
ret = media_entity_init(me, IPIPEIF_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -785,7 +785,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, 0);
|
||||
ret = media_entity_init(me, RESIZER_PADS_NUM, pads);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -1102,7 +1102,7 @@ int omap4iss_video_init(struct iss_video *video, const char *name)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = media_entity_init(&video->video.entity, 1, &video->pad, 0);
|
||||
ret = media_entity_init(&video->video.entity, 1, &video->pad);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
|
@ -134,7 +134,7 @@ struct media_entity_graph {
|
||||
};
|
||||
|
||||
int media_entity_init(struct media_entity *entity, u16 num_pads,
|
||||
struct media_pad *pads, u16 extra_links);
|
||||
struct media_pad *pads);
|
||||
void media_entity_cleanup(struct media_entity *entity);
|
||||
|
||||
int media_entity_create_link(struct media_entity *source, u16 source_pad,
|
||||
|
Loading…
Reference in New Issue
Block a user