diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2014-12-07 09:59:42 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2014-12-16 20:21:39 -0500 |
commit | 454a4e728dd56c8515b80381c14168099279e7fc (patch) | |
tree | 45f99d5b5726ed8f68b3e4554255714ff8e3abac | |
parent | bb9ff078860f9d2f79d3a6bea3af9f48354ddb75 (diff) |
[media] v4l2-ioctl: WARN_ON if querycap didn't fill device_caps
This is easy to forget to do in drivers. While v4l2-compliance will check for it,
not everyone remembers to run it. So warn about it.
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index 75658717961f..faac2f4e0f3a 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c | |||
@@ -1017,6 +1017,12 @@ static int v4l_querycap(const struct v4l2_ioctl_ops *ops, | |||
1017 | ret = ops->vidioc_querycap(file, fh, cap); | 1017 | ret = ops->vidioc_querycap(file, fh, cap); |
1018 | 1018 | ||
1019 | cap->capabilities |= V4L2_CAP_EXT_PIX_FORMAT; | 1019 | cap->capabilities |= V4L2_CAP_EXT_PIX_FORMAT; |
1020 | /* | ||
1021 | * Drivers MUST fill in device_caps, so check for this and | ||
1022 | * warn if it was forgotten. | ||
1023 | */ | ||
1024 | WARN_ON(!(cap->capabilities & V4L2_CAP_DEVICE_CAPS) || | ||
1025 | !cap->device_caps); | ||
1020 | cap->device_caps |= V4L2_CAP_EXT_PIX_FORMAT; | 1026 | cap->device_caps |= V4L2_CAP_EXT_PIX_FORMAT; |
1021 | 1027 | ||
1022 | return ret; | 1028 | return ret; |