diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2016-09-05 16:04:52 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@s-opensource.com> | 2016-10-21 19:20:01 +0300 |
commit | 6d8d61fe661aa6466ed709e5459cd3255dea87b9 (patch) | |
tree | d8b88236f2b23321d6955af2954f035ad76b6f26 /drivers/media/i2c/smiapp | |
parent | cc1488a1fcdcf8fee3ca12c82f5a48745b7fa45d (diff) | |
download | linux-6d8d61fe661aa6466ed709e5459cd3255dea87b9.tar.xz |
[media] smiapp: Initialise media entity after sensor init
This allows determining the number of pads in the entity based on the
sensor.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/i2c/smiapp')
-rw-r--r-- | drivers/media/i2c/smiapp/smiapp-core.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c index 2090b7f2b9aa..4f9750324150 100644 --- a/drivers/media/i2c/smiapp/smiapp-core.c +++ b/drivers/media/i2c/smiapp/smiapp-core.c @@ -3058,12 +3058,7 @@ static int smiapp_probe(struct i2c_client *client, sensor->src->sd.internal_ops = &smiapp_internal_src_ops; sensor->src->sd.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; sensor->src->sensor = sensor; - sensor->src->pads[0].flags = MEDIA_PAD_FL_SOURCE; - rval = media_entity_pads_init(&sensor->src->sd.entity, 2, - sensor->src->pads); - if (rval < 0) - return rval; if (client->dev.of_node) { rval = smiapp_init(sensor); @@ -3071,6 +3066,11 @@ static int smiapp_probe(struct i2c_client *client, goto out_media_entity_cleanup; } + rval = media_entity_pads_init(&sensor->src->sd.entity, 2, + sensor->src->pads); + if (rval < 0) + goto out_media_entity_cleanup; + rval = v4l2_async_register_subdev(&sensor->src->sd); if (rval < 0) goto out_media_entity_cleanup; |