]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tty: make tty_ldisc_ops::hangup return void
authorJiri Slaby <jslaby@suse.cz>
Tue, 14 Sep 2021 09:11:22 +0000 (11:11 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 22 Sep 2021 14:59:13 +0000 (16:59 +0200)
The documentation says that the return value of tty_ldisc_ops::hangup
hook is ignored. And it really is, so there is no point for its return
type to be int. Switch it to void and all the hooks too.

Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Wolfgang Grandegger <wg@grandegger.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Jakub Kicinski <kuba@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Liam Girdwood <lgirdwood@gmail.com>
Cc: Mark Brown <broonie@kernel.org>
Cc: Jaroslav Kysela <perex@perex.cz>
Cc: Takashi Iwai <tiwai@suse.com>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: Mark Brown <broonie@kernel.org>
Acked-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210914091134.17426-4-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/driver-api/serial/tty.rst
drivers/input/serio/serport.c
drivers/net/can/slcan.c
drivers/net/ppp/ppp_async.c
drivers/net/ppp/ppp_synctty.c
drivers/net/slip/slip.c
include/linux/tty_ldisc.h
sound/soc/codecs/cx20442.c
sound/soc/ti/ams-delta.c

index dd972caacf3ee6f04ba8b8c7fb57196551c21a8f..4b709f392713d42c68c663d582a524d65de04a81 100644 (file)
@@ -58,7 +58,7 @@ close()                       This is called on a terminal when the line
 hangup()               Called when the tty line is hung up.
                        The line discipline should cease I/O to the tty.
                        No further calls into the ldisc code will occur.
-                       The return value is ignored. Can sleep.
+                       Can sleep.
 
 read()                 (optional) A process requests reading data from
                        the line. Multiple read calls may occur in parallel
index 7fbbe00e3553c921c5f65f886be91f222e45cbbd..17eb8f2aa48dd324ee2fb262a99eaad9511deea9 100644 (file)
@@ -244,7 +244,7 @@ static int serport_ldisc_compat_ioctl(struct tty_struct *tty,
 }
 #endif
 
-static int serport_ldisc_hangup(struct tty_struct *tty)
+static void serport_ldisc_hangup(struct tty_struct *tty)
 {
        struct serport *serport = (struct serport *) tty->disc_data;
        unsigned long flags;
@@ -254,7 +254,6 @@ static int serport_ldisc_hangup(struct tty_struct *tty)
        spin_unlock_irqrestore(&serport->lock, flags);
 
        wake_up_interruptible(&serport->wait);
-       return 0;
 }
 
 static void serport_ldisc_write_wakeup(struct tty_struct * tty)
index d42ec7d1bc1466b2c7d913739e8a20c952088aa8..012da4b8abe0a466d95e0ae9c6f52a94fb83d584 100644 (file)
@@ -664,10 +664,9 @@ static void slcan_close(struct tty_struct *tty)
        /* This will complete via sl_free_netdev */
 }
 
-static int slcan_hangup(struct tty_struct *tty)
+static void slcan_hangup(struct tty_struct *tty)
 {
        slcan_close(tty);
-       return 0;
 }
 
 /* Perform I/O control on an active SLCAN channel. */
index 29a93d6bfe37f87c0c97d91c2f1ee90fba21e2e7..78ec1bcebc4fcb23b6c66beb406476c5fc640818 100644 (file)
@@ -247,10 +247,9 @@ ppp_asynctty_close(struct tty_struct *tty)
  * Wait for I/O to driver to complete and unregister PPP channel.
  * This is already done by the close routine, so just call that.
  */
-static int ppp_asynctty_hangup(struct tty_struct *tty)
+static void ppp_asynctty_hangup(struct tty_struct *tty)
 {
        ppp_asynctty_close(tty);
-       return 0;
 }
 
 /*
index af3e048695b662f256c1d4e51c6427d2eb23fc18..c249db7c466a6d9182d6cf8bcb972714589275a3 100644 (file)
@@ -245,10 +245,9 @@ ppp_sync_close(struct tty_struct *tty)
  * Wait for I/O to driver to complete and unregister PPP channel.
  * This is already done by the close routine, so just call that.
  */
-static int ppp_sync_hangup(struct tty_struct *tty)
+static void ppp_sync_hangup(struct tty_struct *tty)
 {
        ppp_sync_close(tty);
-       return 0;
 }
 
 /*
index 5435b5689ce6b7969cf902df3e86682c070487be..8be9d0c351b5bbd29e6eaec917fb62ea1e6d39c6 100644 (file)
@@ -907,10 +907,9 @@ static void slip_close(struct tty_struct *tty)
        /* This will complete via sl_free_netdev */
 }
 
-static int slip_hangup(struct tty_struct *tty)
+static void slip_hangup(struct tty_struct *tty)
 {
        slip_close(tty);
-       return 0;
 }
  /************************************************************************
   *                    STANDARD SLIP ENCAPSULATION                      *
index 4d1c128afbface590650f7dc845977971c0cf2bf..b85d84fb5f4956221389968ffed3f1945aed1087 100644 (file)
@@ -199,7 +199,7 @@ struct tty_ldisc_ops {
        void    (*set_termios)(struct tty_struct *tty, struct ktermios *old);
        __poll_t (*poll)(struct tty_struct *, struct file *,
                             struct poll_table_struct *);
-       int     (*hangup)(struct tty_struct *tty);
+       void    (*hangup)(struct tty_struct *tty);
 
        /*
         * The following routines are called from below.
index 13258f3ca9aae76b709bcda872739ab24c530fc7..1af0bf5f1e2f5b0ffd1a2563cad944f9151d0460 100644 (file)
@@ -252,10 +252,9 @@ static void v253_close(struct tty_struct *tty)
 }
 
 /* Line discipline .hangup() */
-static int v253_hangup(struct tty_struct *tty)
+static void v253_hangup(struct tty_struct *tty)
 {
        v253_close(tty);
-       return 0;
 }
 
 /* Line discipline .receive_buf() */
index ecd24d412a9b01771bae50b6847059533ee1a921..b1a32545babdb8881d58f64e0bdb9ad5bb72d3ca 100644 (file)
@@ -330,10 +330,9 @@ static void cx81801_close(struct tty_struct *tty)
 }
 
 /* Line discipline .hangup() */
-static int cx81801_hangup(struct tty_struct *tty)
+static void cx81801_hangup(struct tty_struct *tty)
 {
        cx81801_close(tty);
-       return 0;
 }
 
 /* Line discipline .receive_buf() */