Commit 28f194da authored by Jiri Slaby's avatar Jiri Slaby Committed by Greg Kroah-Hartman
Browse files

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: default avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
Acked-by: default avatarMark Brown <broonie@kernel.org>
Acked-by: default avatarMarc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210914091134.17426-4-jslaby@suse.cz


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 78941934
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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
+1 −2
Original line number Diff line number Diff line
@@ -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)
+1 −2
Original line number Diff line number Diff line
@@ -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. */
+1 −2
Original line number Diff line number Diff line
@@ -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;
}

/*
+1 −2
Original line number Diff line number Diff line
@@ -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;
}

/*
Loading