From 70f54841a403862e0eb26fe0ec21f41f05b2cd99 Mon Sep 17 00:00:00 2001 From: Rasmus Villemoes Date: Fri, 5 Jan 2024 21:58:47 +0100 Subject: [PATCH] tty/module.c: fix prototype of ec_tty_write for >= 6.6 Upstream commit 95713967ba523 changed the prototype of tty_operations::write. --- tty/module.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tty/module.c b/tty/module.c index 551deb0c..b472c876 100644 --- a/tty/module.c +++ b/tty/module.c @@ -496,17 +496,26 @@ static void ec_tty_close(struct tty_struct *tty, struct file *file) /*****************************************************************************/ -static int ec_tty_write( +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) +static ssize_t +#else +static int +#endif +ec_tty_write( struct tty_struct *tty, const unsigned char *buffer, +#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 6, 0) + size_t count +#else int count +#endif ) { ec_tty_t *t = (ec_tty_t *) tty->driver_data; unsigned int data_size, i; #if EC_TTY_DEBUG >= 1 - printk(KERN_INFO PFX "%s(count=%i)\n", __func__, count); + printk(KERN_INFO PFX "%s(count=%i)\n", __func__, (int)count); #endif if (count <= 0) {