Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: make tty_ldisc_ops::hangup return void

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>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
28f194da 78941934

+9 -16
+1 -1
Documentation/driver-api/serial/tty.rst
··· 58 58 hangup() Called when the tty line is hung up. 59 59 The line discipline should cease I/O to the tty. 60 60 No further calls into the ldisc code will occur. 61 - The return value is ignored. Can sleep. 61 + Can sleep. 62 62 63 63 read() (optional) A process requests reading data from 64 64 the line. Multiple read calls may occur in parallel
+1 -2
drivers/input/serio/serport.c
··· 244 244 } 245 245 #endif 246 246 247 - static int serport_ldisc_hangup(struct tty_struct *tty) 247 + static void serport_ldisc_hangup(struct tty_struct *tty) 248 248 { 249 249 struct serport *serport = (struct serport *) tty->disc_data; 250 250 unsigned long flags; ··· 254 254 spin_unlock_irqrestore(&serport->lock, flags); 255 255 256 256 wake_up_interruptible(&serport->wait); 257 - return 0; 258 257 } 259 258 260 259 static void serport_ldisc_write_wakeup(struct tty_struct * tty)
+1 -2
drivers/net/can/slcan.c
··· 664 664 /* This will complete via sl_free_netdev */ 665 665 } 666 666 667 - static int slcan_hangup(struct tty_struct *tty) 667 + static void slcan_hangup(struct tty_struct *tty) 668 668 { 669 669 slcan_close(tty); 670 - return 0; 671 670 } 672 671 673 672 /* Perform I/O control on an active SLCAN channel. */
+1 -2
drivers/net/ppp/ppp_async.c
··· 247 247 * Wait for I/O to driver to complete and unregister PPP channel. 248 248 * This is already done by the close routine, so just call that. 249 249 */ 250 - static int ppp_asynctty_hangup(struct tty_struct *tty) 250 + static void ppp_asynctty_hangup(struct tty_struct *tty) 251 251 { 252 252 ppp_asynctty_close(tty); 253 - return 0; 254 253 } 255 254 256 255 /*
+1 -2
drivers/net/ppp/ppp_synctty.c
··· 245 245 * Wait for I/O to driver to complete and unregister PPP channel. 246 246 * This is already done by the close routine, so just call that. 247 247 */ 248 - static int ppp_sync_hangup(struct tty_struct *tty) 248 + static void ppp_sync_hangup(struct tty_struct *tty) 249 249 { 250 250 ppp_sync_close(tty); 251 - return 0; 252 251 } 253 252 254 253 /*
+1 -2
drivers/net/slip/slip.c
··· 907 907 /* This will complete via sl_free_netdev */ 908 908 } 909 909 910 - static int slip_hangup(struct tty_struct *tty) 910 + static void slip_hangup(struct tty_struct *tty) 911 911 { 912 912 slip_close(tty); 913 - return 0; 914 913 } 915 914 /************************************************************************ 916 915 * STANDARD SLIP ENCAPSULATION *
+1 -1
include/linux/tty_ldisc.h
··· 199 199 void (*set_termios)(struct tty_struct *tty, struct ktermios *old); 200 200 __poll_t (*poll)(struct tty_struct *, struct file *, 201 201 struct poll_table_struct *); 202 - int (*hangup)(struct tty_struct *tty); 202 + void (*hangup)(struct tty_struct *tty); 203 203 204 204 /* 205 205 * The following routines are called from below.
+1 -2
sound/soc/codecs/cx20442.c
··· 252 252 } 253 253 254 254 /* Line discipline .hangup() */ 255 - static int v253_hangup(struct tty_struct *tty) 255 + static void v253_hangup(struct tty_struct *tty) 256 256 { 257 257 v253_close(tty); 258 - return 0; 259 258 } 260 259 261 260 /* Line discipline .receive_buf() */
+1 -2
sound/soc/ti/ams-delta.c
··· 330 330 } 331 331 332 332 /* Line discipline .hangup() */ 333 - static int cx81801_hangup(struct tty_struct *tty) 333 + static void cx81801_hangup(struct tty_struct *tty) 334 334 { 335 335 cx81801_close(tty); 336 - return 0; 337 336 } 338 337 339 338 /* Line discipline .receive_buf() */