[media] staging/media: fix querycap
authorHans Verkuil <hans.verkuil@cisco.com>
Mon, 24 Nov 2014 09:37:22 +0000 (06:37 -0300)
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>
Tue, 2 Dec 2014 13:30:04 +0000 (11:30 -0200)
Querycap shouldn't set the version field (the core does that for you),
but it should set the device_caps field.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
drivers/staging/media/bcm2048/radio-bcm2048.c
drivers/staging/media/davinci_vpfe/vpfe_video.c
drivers/staging/media/dt3155v4l/dt3155v4l.c

index bdc6854d8b53867f8fe950c06f86344c36bd0c82..60a57b2a8fb208499cde841ee0bab41c50559ff6 100644 (file)
@@ -2327,9 +2327,10 @@ static int bcm2048_vidioc_querycap(struct file *file, void *priv,
        strlcpy(capability->card, BCM2048_DRIVER_CARD,
                sizeof(capability->card));
        snprintf(capability->bus_info, 32, "I2C: 0x%X", bdev->client->addr);
-       capability->version = BCM2048_DRIVER_VERSION;
-       capability->capabilities = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
+       capability->device_caps = V4L2_CAP_TUNER | V4L2_CAP_RADIO |
                                        V4L2_CAP_HW_FREQ_SEEK;
+       capability->capabilities = capability->device_caps |
+               V4L2_CAP_DEVICE_CAPS;
 
        return 0;
 }
index 6f9171c39bdc8cc5ad270de4ac2c418bec877de8..06d48d5eb0a0aa3d47a4cf242a0aaf96d0119392 100644 (file)
@@ -600,11 +600,11 @@ static int vpfe_querycap(struct file *file, void  *priv,
        v4l2_dbg(1, debug, &vpfe_dev->v4l2_dev, "vpfe_querycap\n");
 
        if (video->type == V4L2_BUF_TYPE_VIDEO_CAPTURE)
-               cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
+               cap->device_caps = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_STREAMING;
        else
-               cap->capabilities = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
-       cap->device_caps = cap->capabilities;
-       cap->version = VPFE_CAPTURE_VERSION_CODE;
+               cap->device_caps = V4L2_CAP_VIDEO_OUTPUT | V4L2_CAP_STREAMING;
+       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE | V4L2_CAP_VIDEO_OUTPUT |
+                           V4L2_CAP_STREAMING | V4L2_CAP_DEVICE_CAPS;
        strlcpy(cap->driver, CAPTURE_DRV_NAME, sizeof(cap->driver));
        strlcpy(cap->bus_info, "VPFE", sizeof(cap->bus_info));
        strlcpy(cap->card, vpfe_dev->cfg->card_name, sizeof(cap->card));
index 40580228a6c72d1e169ae5de2d2ed6318645af88..293ffda503e06be82bf4bf6697f29e238fef86ed 100644 (file)
@@ -512,10 +512,9 @@ dt3155_ioc_querycap(struct file *filp, void *p, struct v4l2_capability *cap)
        strcpy(cap->driver, DT3155_NAME);
        strcpy(cap->card, DT3155_NAME " frame grabber");
        sprintf(cap->bus_info, "PCI:%s", pci_name(pd->pdev));
-       cap->version =
-              KERNEL_VERSION(DT3155_VER_MAJ, DT3155_VER_MIN, DT3155_VER_EXT);
-       cap->capabilities = V4L2_CAP_VIDEO_CAPTURE |
+       cap->device_caps = V4L2_CAP_VIDEO_CAPTURE |
                                DT3155_CAPTURE_METHOD;
+       cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;
 }