Commit 8307a99a53eb80afdc30d158253ea087f7d89900

Authored by Matthew Bakhtiari
1 parent 5f8d18dd

tty0tty: port `tty.h` calls to `5.14+`

See: https://github.com/torvalds/linux/commit/9f90a4ddef4e4d3aa4229f6b117d4e57231457b3
Closes: #36
Closes: #35
Signed-off-by: Matthew Bakhtiari <dev@mtbk.me>
Showing 1 changed file with 3 additions and 3 deletions
module/tty0tty.c
@@ -258,7 +258,7 @@ exit: @@ -258,7 +258,7 @@ exit:
258 return retval; 258 return retval;
259 } 259 }
260 260
261 -static int tty0tty_write_room(struct tty_struct *tty) 261 +static unsigned int tty0tty_write_room(struct tty_struct *tty)
262 { 262 {
263 struct tty0tty_serial *tty0tty = tty->driver_data; 263 struct tty0tty_serial *tty0tty = tty->driver_data;
264 int room = -EINVAL; 264 int room = -EINVAL;
@@ -628,7 +628,7 @@ static int __init tty0tty_init(void) @@ -628,7 +628,7 @@ static int __init tty0tty_init(void)
628 printk(KERN_DEBUG "%s - \n", __FUNCTION__); 628 printk(KERN_DEBUG "%s - \n", __FUNCTION__);
629 #endif 629 #endif
630 /* allocate the tty driver */ 630 /* allocate the tty driver */
631 - tty0tty_tty_driver = alloc_tty_driver(2 * pairs); 631 + tty0tty_tty_driver = tty_alloc_driver(2 * pairs, 0);
632 if (!tty0tty_tty_driver) 632 if (!tty0tty_tty_driver)
633 return -ENOMEM; 633 return -ENOMEM;
634 634
@@ -664,7 +664,7 @@ static int __init tty0tty_init(void) @@ -664,7 +664,7 @@ static int __init tty0tty_init(void)
664 retval = tty_register_driver(tty0tty_tty_driver); 664 retval = tty_register_driver(tty0tty_tty_driver);
665 if (retval) { 665 if (retval) {
666 printk(KERN_ERR "failed to register tty0tty tty driver"); 666 printk(KERN_ERR "failed to register tty0tty tty driver");
667 - put_tty_driver(tty0tty_tty_driver); 667 + tty_driver_kref_put(tty0tty_tty_driver);
668 return retval; 668 return retval;
669 } 669 }
670 670