summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>2016-05-13 13:09:25 -0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2016-06-28 12:10:42 -0300
commitaa0bad337ff231882dc8849f2234138281b5c414 (patch)
tree7f10430e4ec7bed203388586b791835ab8b2be01 /drivers
parent078e04993aef1bc7388e99dba99f6793e246c659 (diff)
downloadlinux-stable-aa0bad337ff231882dc8849f2234138281b5c414.tar.gz
linux-stable-aa0bad337ff231882dc8849f2234138281b5c414.tar.bz2
linux-stable-aa0bad337ff231882dc8849f2234138281b5c414.zip
[media] v4l: vsp1: Don't register media device when userspace API is disabled
The media device doesn't need to be exposed to userspace when the VSP is fully controlled by the DU driver. Don't register it in that case. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/platform/vsp1/vsp1_drv.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/media/platform/vsp1/vsp1_drv.c b/drivers/media/platform/vsp1/vsp1_drv.c
index 7e3b9da5aa11..71fd614c1412 100644
--- a/drivers/media/platform/vsp1/vsp1_drv.c
+++ b/drivers/media/platform/vsp1/vsp1_drv.c
@@ -206,7 +206,8 @@ static void vsp1_destroy_entities(struct vsp1_device *vsp1)
}
v4l2_device_unregister(&vsp1->v4l2_dev);
- media_device_unregister(&vsp1->media_dev);
+ if (vsp1->info->uapi)
+ media_device_unregister(&vsp1->media_dev);
media_device_cleanup(&vsp1->media_dev);
if (!vsp1->info->uapi)
@@ -381,14 +382,15 @@ static int vsp1_create_entities(struct vsp1_device *vsp1)
/* Register subdev nodes if the userspace API is enabled or initialize
* the DRM pipeline otherwise.
*/
- if (vsp1->info->uapi)
+ if (vsp1->info->uapi) {
ret = v4l2_device_register_subdev_nodes(&vsp1->v4l2_dev);
- else
- ret = vsp1_drm_init(vsp1);
- if (ret < 0)
- goto done;
+ if (ret < 0)
+ goto done;
- ret = media_device_register(mdev);
+ ret = media_device_register(mdev);
+ } else {
+ ret = vsp1_drm_init(vsp1);
+ }
done:
if (ret < 0)