Commit ae6db515 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] v4l2-ioctl: Add a default value for kernel version

Most drivers don't increase kernel versions as newer features are added or
bug fixes are solved. So, vidioc_querycap returned value for cap->version is
meaningless. Instead of keeping this situation forever, let's add a default
value matching the current Linux version.

Drivers that want to keep their own version control can still do it, as they
can override the default value for cap->version.
Acked-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b6dc1bab
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/types.h> #include <linux/types.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/version.h>
#include <linux/videodev2.h> #include <linux/videodev2.h>
...@@ -605,6 +606,7 @@ static long __video_do_ioctl(struct file *file, ...@@ -605,6 +606,7 @@ static long __video_do_ioctl(struct file *file,
if (!ops->vidioc_querycap) if (!ops->vidioc_querycap)
break; break;
cap->version = LINUX_VERSION_CODE;
ret = ops->vidioc_querycap(file, fh, cap); ret = ops->vidioc_querycap(file, fh, cap);
if (!ret) if (!ret)
dbgarg(cmd, "driver=%s, card=%s, bus=%s, " dbgarg(cmd, "driver=%s, card=%s, bus=%s, "
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment