Commit db6516ae3abd622d9b620815ef89a2bdec281ba5
Committed by
GitHub
Merge pull request #38 from AltF02/master
tty0tty: port `tty.h` calls to `5.14+`
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 |