Skip to content

Commit

Permalink
Fixes #70 with backward compatibility. kernel version
Browse files Browse the repository at this point in the history
5.14.17 is the first among mainline, stable, and longterm kernels in which
  this change is needed. kernel version check added for v5.14
  • Loading branch information
QuantumForge authored and dwalkes committed Nov 9, 2021
1 parent a7d2371 commit d189772
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tty/tiny_tty.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#include <linux/sched/signal.h>
#include <linux/seq_file.h>
#include <linux/uaccess.h>
#include <linux/version.h>

#define DRIVER_VERSION "v2.0"
#define DRIVER_AUTHOR "Greg Kroah-Hartman <[email protected]>"
Expand Down Expand Up @@ -193,7 +194,11 @@ static int tiny_write(struct tty_struct *tty,
return retval;
}

static unsigned int tiny_write_room(struct tty_struct *tty)
#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 14, 0))
static int tiny_write_room(struct tty_struct *tty)
#else
unsigned int tiny_write_room(struct tty_struct *tty)
#endif
{
struct tiny_serial *tiny = tty->driver_data;
int room = -EINVAL;
Expand Down

0 comments on commit d189772

Please sign in to comment.