From 9d7ff828ebe9c455108e6039b45cd06c693597a2 Mon Sep 17 00:00:00 2001 From: Andreas Kemnade Date: Mon, 25 Nov 2019 13:17:00 +0100 Subject: [PATCH] facetimehd: set device_caps in video_device In kernel 5.4 I otherwise get this warning WARNING: CPU: 1 PID: 451 at drivers/media/v4l2-core/v4l2-dev.c:863 __video_register_device+0x64b/0xe90 [videodev] The code there is: /* the device_caps field MUST be set for all but subdevs */ if (WARN_ON(type != VFL_TYPE_SUBDEV && !vdev->device_caps)) [patrik: ported this to the mainline branch] Signed-off-by: Andreas Kemnade --- fthd_v4l2.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fthd_v4l2.c b/fthd_v4l2.c index 12c5b1b..10914dd 100644 --- a/fthd_v4l2.c +++ b/fthd_v4l2.c @@ -728,6 +728,8 @@ int fthd_v4l2_register(struct fthd_private *dev_priv) vdev->queue = q; vdev->release = video_device_release; vdev->ctrl_handler = &dev_priv->v4l2_ctrl_handler; + vdev->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | + V4L2_CAP_STREAMING; video_set_drvdata(vdev, dev_priv); ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);