Remove .hangup()
authornorly <ny-git@enpas.org>
Tue, 26 Apr 2022 22:33:15 +0000 (00:33 +0200)
committernorly <ny-git@enpas.org>
Thu, 28 Apr 2022 00:23:34 +0000 (02:23 +0200)
We were just calling .close(), which the TTY layer does for us anyway.
And it does so with the correct locking.

module/elmcan.c

index 75f13590ceb3ddd63582a4f929d7c1e6b6cf74a8..7bb2784587f62a67d0db9ce619c31758fda92118 100644 (file)
@@ -1113,18 +1113,6 @@ static void elmcan_ldisc_close(struct tty_struct *tty)
        free_candev(elm->dev);
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5,16,0)
-static int elmcan_ldisc_hangup(struct tty_struct *tty)
-#else
-static void elmcan_ldisc_hangup(struct tty_struct *tty)
-#endif
-{
-       elmcan_ldisc_close(tty);
-#if LINUX_VERSION_CODE < KERNEL_VERSION(5,16,0)
-       return 0;
-#endif
-}
-
 static int elmcan_ldisc_ioctl(struct tty_struct *tty,
 #if LINUX_VERSION_CODE < KERNEL_VERSION(5,17,0)
                              struct file *file,
@@ -1161,7 +1149,6 @@ static struct tty_ldisc_ops elmcan_ldisc = {
        .write_wakeup   = elmcan_ldisc_tx_wakeup,
        .open           = elmcan_ldisc_open,
        .close          = elmcan_ldisc_close,
-       .hangup         = elmcan_ldisc_hangup,
        .ioctl          = elmcan_ldisc_ioctl,
 };