1 Fix building against 5.7 or newer kernels
3 VFL_TYPE_GRABBER was renamed VFL_TYPE_VIDEO in 5.7. Marking as
4 inappropriate for upstream for now, as it seems the standalone
5 version of the driver has been superceded by the version in the
6 staging tree in the mainline kernel, and there are no obvious
9 Upstream-Status: Inappropriate [no upstream]
10 Signed-off-by: Scott Murray <scott.murray@konsulko.com>
13 diff --git a/aim-v4l2/video.c b/aim-v4l2/video.c
14 index db75d4d..fbf7139 100644
15 --- a/aim-v4l2/video.c
16 +++ b/aim-v4l2/video.c
18 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
20 #include <linux/module.h>
21 +#include <linux/version.h>
22 #include <linux/slab.h>
23 #include <linux/init.h>
24 #include <linux/device.h>
27 #define V4L2_AIM_MAX_INPUT 1
29 +#if LINUX_VERSION_CODE < KERNEL_VERSION(5,7,0)
30 +/* Handle pre-5.7 naming */
31 +#define VFL_TYPE_VIDEO VFL_TYPE_GRABBER
34 static struct most_aim aim_info;
36 struct most_video_dev {
37 @@ -82,7 +88,7 @@ static int aim_vdev_open(struct file *filp)
38 v4l2_info(&mdev->v4l2_dev, "aim_vdev_open()\n");
40 switch (vdev->vfl_type) {
41 - case VFL_TYPE_GRABBER:
42 + case VFL_TYPE_VIDEO:
46 @@ -461,7 +467,7 @@ static int aim_register_videodev(struct most_video_dev *mdev)
48 /* Register the v4l2 device */
49 video_set_drvdata(mdev->vdev, mdev);
50 - ret = video_register_device(mdev->vdev, VFL_TYPE_GRABBER, -1);
51 + ret = video_register_device(mdev->vdev, VFL_TYPE_VIDEO, -1);
53 v4l2_err(&mdev->v4l2_dev, "video_register_device failed (%d)\n",