Prepare for Gen2 media graph support by always initializing a media pad for the VIN device. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx> Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx> --- * Changes since v4 - New in v5, broken out from a larger patch in v4. --- drivers/media/platform/renesas/rcar-vin/rcar-core.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/renesas/rcar-vin/rcar-core.c b/drivers/media/platform/renesas/rcar-vin/rcar-core.c index b3558c3c44d1..7367b5c993cd 100644 --- a/drivers/media/platform/renesas/rcar-vin/rcar-core.c +++ b/drivers/media/platform/renesas/rcar-vin/rcar-core.c @@ -895,10 +895,6 @@ static int rvin_csi2_init(struct rvin_dev *vin) { int ret; - vin->pad.flags = MEDIA_PAD_FL_SINK; - ret = media_entity_pads_init(&vin->vdev.entity, 1, &vin->pad); - if (ret) - return ret; ret = rvin_create_controls(vin, NULL); if (ret < 0) @@ -980,10 +976,6 @@ static int rvin_isp_init(struct rvin_dev *vin) { int ret; - vin->pad.flags = MEDIA_PAD_FL_SINK; - ret = media_entity_pads_init(&vin->vdev.entity, 1, &vin->pad); - if (ret) - return ret; ret = rvin_create_controls(vin, NULL); if (ret < 0) @@ -1377,6 +1369,11 @@ static int rcar_vin_probe(struct platform_device *pdev) goto err_dma; } + vin->pad.flags = MEDIA_PAD_FL_SINK; + ret = media_entity_pads_init(&vin->vdev.entity, 1, &vin->pad); + if (ret) + goto err_id; + if (vin->info->use_isp) { ret = rvin_isp_init(vin); } else if (vin->info->use_mc) { -- 2.49.0