tty: Implemented new timer interface since kernel 6.15.
Signed-off-by: Bernd Kuhls <bernd@kuhls.net>
This commit is contained in:
parent
7a7d7f051b
commit
e32e99f8b8
|
|
@ -233,7 +233,11 @@ static void __exit cleanup_mini_module(void)
|
||||||
{
|
{
|
||||||
printk(KERN_INFO PFX "Stopping...\n");
|
printk(KERN_INFO PFX "Stopping...\n");
|
||||||
|
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||||
|
timer_delete_sync(&timer);
|
||||||
|
#else
|
||||||
del_timer_sync(&timer);
|
del_timer_sync(&timer);
|
||||||
|
#endif
|
||||||
|
|
||||||
free_serial_devices();
|
free_serial_devices();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -292,7 +292,11 @@ static int ec_tty_init(ec_tty_t *t, int minor,
|
||||||
|
|
||||||
static void ec_tty_clear(ec_tty_t *tty)
|
static void ec_tty_clear(ec_tty_t *tty)
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||||
|
timer_delete_sync(&tty->timer);
|
||||||
|
#else
|
||||||
del_timer_sync(&tty->timer);
|
del_timer_sync(&tty->timer);
|
||||||
|
#endif
|
||||||
tty_unregister_device(tty_driver, tty->minor);
|
tty_unregister_device(tty_driver, tty->minor);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -367,10 +371,14 @@ static void ec_tty_wakeup(struct timer_list *t)
|
||||||
static void ec_tty_wakeup(unsigned long data)
|
static void ec_tty_wakeup(unsigned long data)
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(6, 15, 0)
|
||||||
|
ec_tty_t *tty = timer_container_of(tty, t, timer);
|
||||||
|
#else
|
||||||
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 15, 0)
|
||||||
ec_tty_t *tty = from_timer(tty, t, timer);
|
ec_tty_t *tty = from_timer(tty, t, timer);
|
||||||
#else
|
#else
|
||||||
ec_tty_t *tty = (ec_tty_t *) data;
|
ec_tty_t *tty = (ec_tty_t *) data;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
size_t to_recv;
|
size_t to_recv;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue