From: Hans Verkuil <hans.verkuil@xxxxxxxxx> Signed-off-by: Hans Verkuil <hans.verkuil@xxxxxxxxx> --- drivers/media/platform/vimc/vimc-common.c | 18 ++++++++++++++++++ drivers/media/platform/vimc/vimc-core.c | 6 +++--- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c index 617415c224fe..db8a8d1eca54 100644 --- a/drivers/media/platform/vimc/vimc-common.c +++ b/drivers/media/platform/vimc/vimc-common.c @@ -452,6 +452,24 @@ int vimc_ent_sd_register(struct vimc_ent_device *ved, goto err_clean_m_ent; } + ret = media_entity_add_prop_u64(&sd->entity, "u64", ~1); + if (!ret) + ret = media_entity_add_prop_s64(&sd->entity, "s64", -5); + if (!ret) + ret = media_entity_add_prop_string(&sd->entity, "string", + sd->name); + if (!ret) + ret = media_pad_add_prop_u64(&sd->entity.pads[num_pads - 1], + "u64", ~1); + if (!ret) + ret = media_pad_add_prop_s64(&sd->entity.pads[num_pads - 1], + "s64", -5); + if (!ret) + ret = media_pad_add_prop_string(&sd->entity.pads[0], + "string", sd->name); + if (ret) + goto err_clean_m_ent; + return 0; err_clean_m_ent: diff --git a/drivers/media/platform/vimc/vimc-core.c b/drivers/media/platform/vimc/vimc-core.c index 9246f265de31..d8d3803a47f9 100644 --- a/drivers/media/platform/vimc/vimc-core.c +++ b/drivers/media/platform/vimc/vimc-core.c @@ -309,13 +309,13 @@ static int vimc_probe(struct platform_device *pdev) if (!vimc->subdevs) return -ENOMEM; + /* Link the media device within the v4l2_device */ + vimc->v4l2_dev.mdev = &vimc->mdev; + match = vimc_add_subdevs(vimc); if (IS_ERR(match)) return PTR_ERR(match); - /* Link the media device within the v4l2_device */ - vimc->v4l2_dev.mdev = &vimc->mdev; - /* Initialize media device */ strlcpy(vimc->mdev.model, VIMC_MDEV_MODEL_NAME, sizeof(vimc->mdev.model)); -- 2.18.0