[media] s5p-mfc: set capablity bus_info as required by VIDIOC_QUERYCAP
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 16 Jun 2016 21:40:30 +0000 (18:40 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Fri, 8 Jul 2016 17:26:28 +0000 (14:26 -0300)
The driver doesn't set the struct v4l2_capability bus_info field so the
v4l2-compliance tool reports the following errors for VIDIOC_QUERYCAP:

Required ioctls:
                VIDIOC_QUERYCAP returned 0 (Success)
                fail: v4l2-compliance.cpp(304): string empty
                fail: v4l2-compliance.cpp(528): check_ustring(vcap.bus_info, sizeof(vcap.bus_info))
        test VIDIOC_QUERYCAP: FAIL

This patch fixes by setting the field in VIDIOC_QUERYCAP ioctl handler:

Required ioctls:
                VIDIOC_QUERYCAP returned 0 (Success)
        test VIDIOC_QUERYCAP: OK

Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Kamil Debski <k.debski@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-mfc/s5p_mfc_dec.c
drivers/media/platform/s5p-mfc/s5p_mfc_enc.c

index d3b01e92ee8027d64fa1ae25cbccd3f1b58b2937..b892e79e2b59ce22f07e1c882d16a711a8c33940 100644 (file)
@@ -267,7 +267,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 
        strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
        strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
-       cap->bus_info[0] = 0;
+       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+                dev_name(&dev->plat_dev->dev));
        /*
         * This is only a mem-to-mem video device. The capture and output
         * device capability flags are left only for backward compatibility
index 2f76aba4cc78d06cd9fde3a3d30de9ca5c12caf4..0bcc3aea2370f4389657c76afb310e18606268b4 100644 (file)
@@ -945,7 +945,8 @@ static int vidioc_querycap(struct file *file, void *priv,
 
        strncpy(cap->driver, dev->plat_dev->name, sizeof(cap->driver) - 1);
        strncpy(cap->card, dev->plat_dev->name, sizeof(cap->card) - 1);
-       cap->bus_info[0] = 0;
+       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+                dev_name(&dev->plat_dev->dev));
        /*
         * This is only a mem-to-mem video device. The capture and output
         * device capability flags are left only for backward compatibility