Skip to content

Commit

Permalink
Remove support for pre-4.0.0 kernels.
Browse files Browse the repository at this point in the history
Signed-off-by: Wren Turkal <wt@penguintechs.org>
  • Loading branch information
wt authored and IOhannes m zmölnig committed May 14, 2023
1 parent f5192e6 commit 9ba7e29
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions v4l2loopback.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
#include <linux/miscdevice.h>
#include "v4l2loopback.h"

#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 6, 1)
#error This module is not supported on kernels before 3.6.1.
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)
#error This module is not supported on kernels before 4.0.0.
#endif

#if defined(timer_setup) && defined(from_timer)
Expand Down Expand Up @@ -94,14 +94,8 @@ MODULE_LICENSE("GPL");

static inline void v4l2l_get_timestamp(struct v4l2_buffer *b)
{
/* ktime_get_ts is considered deprecated, so use ktime_get_ts64 if possible */
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0)
struct timespec ts;
ktime_get_ts(&ts);
#else
struct timespec64 ts;
ktime_get_ts64(&ts);
#endif

b->timestamp.tv_sec = ts.tv_sec;
b->timestamp.tv_usec = (ts.tv_nsec / NSEC_PER_USEC);
Expand Down Expand Up @@ -2501,18 +2495,10 @@ static void init_vdev(struct video_device *vdev, int nr)
#endif

if (debug > 1)
#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
vdev->debug = V4L2_DEBUG_IOCTL | V4L2_DEBUG_IOCTL_ARG;
#else
vdev->dev_debug = V4L2_DEV_DEBUG_IOCTL |
V4L2_DEV_DEBUG_IOCTL_ARG;
#endif

/* since kernel-3.7, there is a new field 'vfl_dir' that has to be
* set to VFL_DIR_M2M for bidirectional devices */
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 7, 0)
vdev->vfl_dir = VFL_DIR_M2M;
#endif

MARK();
}
Expand Down

0 comments on commit 9ba7e29

Please sign in to comment.