[media] s5p-jpeg: set capablity bus_info as required by VIDIOC_QUERYCAP
authorJavier Martinez Canillas <javier@osg.samsung.com>
Thu, 16 Jun 2016 21:40:32 +0000 (18:40 -0300)
committerMauro Carvalho Chehab <mchehab@s-opensource.com>
Wed, 24 Aug 2016 16:31:08 +0000 (13:31 -0300)
The driver doesn't set the struct v4l2_capability cap_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: Jacek Anaszewski <j.anaszewski@samsung.com>
Acked-by: Hans Verkuil <hans.verkuil@cisco.com>
Reviewed-by: Shuah Khan <shuahkh@osg.samsung.com>
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
drivers/media/platform/s5p-jpeg/jpeg-core.c

index 785e6936c881dbda58e4b2d697c9489758df9233..4e0b3c8f08d57ff891aabb24c5b20135c811704f 100644 (file)
@@ -1256,7 +1256,8 @@ static int s5p_jpeg_querycap(struct file *file, void *priv,
                strlcpy(cap->card, S5P_JPEG_M2M_NAME " decoder",
                        sizeof(cap->card));
        }
-       cap->bus_info[0] = 0;
+       snprintf(cap->bus_info, sizeof(cap->bus_info), "platform:%s",
+                dev_name(ctx->jpeg->dev));
        cap->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_M2M;
        cap->capabilities = cap->device_caps | V4L2_CAP_DEVICE_CAPS;
        return 0;