diff --git a/tty/tiny_serial.c b/tty/tiny_serial.c index e81defe0b..83bdda59a 100644 --- a/tty/tiny_serial.c +++ b/tty/tiny_serial.c @@ -141,9 +141,13 @@ static void tiny_set_mctrl(struct uart_port *port, unsigned int mctrl) static void tiny_break_ctl(struct uart_port *port, int break_state) { } - -static void tiny_set_termios(struct uart_port *port, +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)) + static void tiny_set_termios(struct uart_port *port, struct ktermios *new, struct ktermios *old) +#else + static void tiny_set_termios(struct uart_port *port, + struct ktermios *new, const struct ktermios *old) +#endif { int baud, quot, cflag = new->c_cflag; /* get the byte size */ diff --git a/tty/tiny_tty.c b/tty/tiny_tty.c index 8705634e9..07e9279ec 100644 --- a/tty/tiny_tty.c +++ b/tty/tiny_tty.c @@ -223,7 +223,11 @@ static unsigned int tiny_write_room(struct tty_struct *tty) #define RELEVANT_IFLAG(iflag) ((iflag) & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) +#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 1, 0)) static void tiny_set_termios(struct tty_struct *tty, struct ktermios *old_termios) +#else +static void tiny_set_termios(struct tty_struct *tty, const struct ktermios *old_termios) +#endif { unsigned int cflag; @@ -511,7 +515,11 @@ static int __init tiny_init(void) int i; /* allocate the tty driver */ +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)) tiny_tty_driver = alloc_tty_driver(TINY_TTY_MINORS); +#else + tiny_tty_driver = tty_alloc_driver(TINY_TTY_MINORS, 0); +#endif if (!tiny_tty_driver) return -ENOMEM; @@ -535,7 +543,11 @@ static int __init tiny_init(void) retval = tty_register_driver(tiny_tty_driver); if (retval) { pr_err("failed to register tiny tty driver"); +#if (LINUX_VERSION_CODE < KERNEL_VERSION(5, 15, 0)) put_tty_driver(tiny_tty_driver); +#else + tty_driver_kref_put(tiny_tty_driver); +#endif return retval; }