From 272350d0bd716e7bf9fb2f1a6aec4893252b9416 Mon Sep 17 00:00:00 2001 From: Keith Bussell Date: Sat, 6 Jan 2024 15:46:30 -0800 Subject: [PATCH] Update signature of tty write operation to work with Linux kernel 6.6 see https://docs.kernel.org/6.6/driver-api/tty/tty_driver.html#c.tty_operations --- driver/ch341.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/driver/ch341.c b/driver/ch341.c index 89ac21d..8eb2abc 100644 --- a/driver/ch341.c +++ b/driver/ch341.c @@ -643,7 +643,11 @@ static void ch341_tty_close(struct tty_struct *tty, struct file *filp) tty_port_close(&ch341->port, tty, filp); } +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0)) +static ssize_t ch341_tty_write(struct tty_struct *tty, const unsigned char *buf, size_t count) +#else static int ch341_tty_write(struct tty_struct *tty, const unsigned char *buf, int count) +#endif { struct ch341 *ch341 = tty->driver_data; int stat;