From 2161536516edcc0be31109eb1284939119e7ba6d Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 17 Jun 2019 05:36:16 -0400 Subject: media: media/pci: set device_caps in struct video_device Instead of filling in the struct v4l2_capability device_caps field, fill in the struct video_device device_caps field. That way the V4L2 core knows what the capabilities of the video device are. But this only really works if all drivers use this, so convert all pci drivers in this patch. Tested with cx88-blackbird and ivtv PVR-350. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/pci/saa7164/saa7164-encoder.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'drivers/media/pci/saa7164/saa7164-encoder.c') diff --git a/drivers/media/pci/saa7164/saa7164-encoder.c b/drivers/media/pci/saa7164/saa7164-encoder.c index dcfabad8b284..43fdaa2d32bd 100644 --- a/drivers/media/pci/saa7164/saa7164-encoder.c +++ b/drivers/media/pci/saa7164/saa7164-encoder.c @@ -491,16 +491,9 @@ static int vidioc_querycap(struct file *file, void *priv, strscpy(cap->card, saa7164_boards[dev->board].name, sizeof(cap->card)); sprintf(cap->bus_info, "PCI:%s", pci_name(dev->pci)); - - cap->device_caps = - V4L2_CAP_VIDEO_CAPTURE | - V4L2_CAP_READWRITE | - V4L2_CAP_TUNER; - - cap->capabilities = cap->device_caps | - V4L2_CAP_VBI_CAPTURE | - V4L2_CAP_DEVICE_CAPS; - + cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | + V4L2_CAP_TUNER | V4L2_CAP_VBI_CAPTURE | + V4L2_CAP_DEVICE_CAPS; return 0; } @@ -973,6 +966,8 @@ static struct video_device saa7164_mpeg_template = { .ioctl_ops = &mpeg_ioctl_ops, .minor = -1, .tvnorms = SAA7164_NORMS, + .device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_READWRITE | + V4L2_CAP_TUNER, }; static struct video_device *saa7164_encoder_alloc( -- cgit v1.2.3