[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:
@@ -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
|
||||
|
Reference in New Issue
Block a user