diff options
author | Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> | 2019-07-04 20:16:02 +0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab+samsung@kernel.org> | 2019-07-25 18:47:36 +0300 |
commit | 6b4633310ae8a10f8ffacdc3eb6272b013c2adef (patch) | |
tree | 365ea66510cf6bd408cacfc193db0caf0b04956f /drivers | |
parent | 1d99e68ce7fd9b5f5ab01d72455e8acd699e49cc (diff) | |
download | linux-6b4633310ae8a10f8ffacdc3eb6272b013c2adef.tar.xz |
media: rcar-vin: Always setup controls when opening video device
Now that both Gen2 (video device centric) and Gen3 (media device
centric) modes of the driver have controls it is required to always
setup the controls when opening the devices. Remove the check which only
calls v4l2_ctrl_handler_setup() for Gen2 and call it unconditionally.
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/platform/rcar-vin/rcar-v4l2.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 192390c784f7..cfed0a260413 100644 --- a/drivers/media/platform/rcar-vin/rcar-v4l2.c +++ b/drivers/media/platform/rcar-vin/rcar-v4l2.c @@ -790,26 +790,26 @@ static int rvin_open(struct file *file) if (ret) goto err_unlock; - if (vin->info->use_mc) { + if (vin->info->use_mc) ret = v4l2_pipeline_pm_use(&vin->vdev.entity, 1); - if (ret < 0) - goto err_open; - } else { - if (v4l2_fh_is_singular_file(file)) { - ret = rvin_power_parallel(vin, true); - if (ret < 0) - goto err_open; - - ret = v4l2_ctrl_handler_setup(&vin->ctrl_handler); - if (ret) - goto err_parallel; - } - } + else if (v4l2_fh_is_singular_file(file)) + ret = rvin_power_parallel(vin, true); + + if (ret < 0) + goto err_open; + + ret = v4l2_ctrl_handler_setup(&vin->ctrl_handler); + if (ret) + goto err_power; + mutex_unlock(&vin->lock); return 0; -err_parallel: - rvin_power_parallel(vin, false); +err_power: + if (vin->info->use_mc) + v4l2_pipeline_pm_use(&vin->vdev.entity, 0); + else if (v4l2_fh_is_singular_file(file)) + rvin_power_parallel(vin, false); err_open: v4l2_fh_release(file); err_unlock: |