From: Jiri Slaby <jslaby@suse.cz>
To: gregkh@linuxfoundation.org
Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
Jiri Slaby <jslaby@suse.cz>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Wolfgang Grandegger <wg@grandegger.com>,
Marc Kleine-Budde <mkl@pengutronix.de>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>,
Paul Mackerras <paulus@samba.org>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
Takashi Iwai <tiwai@suse.com>,
Peter Ujfalusi <peter.ujfalusi@gmail.com>
Subject: [PATCH 04/16] tty: make tty_ldisc_ops::hangup return void
Date: Tue, 14 Sep 2021 11:11:22 +0200 [thread overview]
Message-ID: <20210914091134.17426-4-jslaby@suse.cz> (raw)
In-Reply-To: <20210914091134.17426-1-jslaby@suse.cz>
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.
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
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>
---
Documentation/driver-api/serial/tty.rst | 2 +-
drivers/input/serio/serport.c | 3 +--
drivers/net/can/slcan.c | 3 +--
drivers/net/ppp/ppp_async.c | 3 +--
drivers/net/ppp/ppp_synctty.c | 3 +--
drivers/net/slip/slip.c | 3 +--
include/linux/tty_ldisc.h | 2 +-
sound/soc/codecs/cx20442.c | 3 +--
sound/soc/ti/ams-delta.c | 3 +--
9 files changed, 9 insertions(+), 16 deletions(-)
diff --git a/Documentation/driver-api/serial/tty.rst b/Documentation/driver-api/serial/tty.rst
index dd972caacf3e..4b709f392713 100644
--- a/Documentation/driver-api/serial/tty.rst
+++ b/Documentation/driver-api/serial/tty.rst
@@ -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
diff --git a/drivers/input/serio/serport.c b/drivers/input/serio/serport.c
index 7fbbe00e3553..17eb8f2aa48d 100644
--- a/drivers/input/serio/serport.c
+++ b/drivers/input/serio/serport.c
@@ -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)
diff --git a/drivers/net/can/slcan.c b/drivers/net/can/slcan.c
index d42ec7d1bc14..012da4b8abe0 100644
--- a/drivers/net/can/slcan.c
+++ b/drivers/net/can/slcan.c
@@ -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. */
diff --git a/drivers/net/ppp/ppp_async.c b/drivers/net/ppp/ppp_async.c
index 29a93d6bfe37..78ec1bcebc4f 100644
--- a/drivers/net/ppp/ppp_async.c
+++ b/drivers/net/ppp/ppp_async.c
@@ -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;
}
/*
diff --git a/drivers/net/ppp/ppp_synctty.c b/drivers/net/ppp/ppp_synctty.c
index af3e048695b6..c249db7c466a 100644
--- a/drivers/net/ppp/ppp_synctty.c
+++ b/drivers/net/ppp/ppp_synctty.c
@@ -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;
}
/*
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index 5435b5689ce6..8be9d0c351b5 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -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 *
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 4d1c128afbfa..b85d84fb5f49 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -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.
diff --git a/sound/soc/codecs/cx20442.c b/sound/soc/codecs/cx20442.c
index 13258f3ca9aa..1af0bf5f1e2f 100644
--- a/sound/soc/codecs/cx20442.c
+++ b/sound/soc/codecs/cx20442.c
@@ -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() */
diff --git a/sound/soc/ti/ams-delta.c b/sound/soc/ti/ams-delta.c
index ecd24d412a9b..b1a32545babd 100644
--- a/sound/soc/ti/ams-delta.c
+++ b/sound/soc/ti/ams-delta.c
@@ -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() */
--
2.33.0
next prev parent reply other threads:[~2021-09-14 9:11 UTC|newest]
Thread overview: 48+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-14 9:11 [PATCH 01/16] tty: unexport tty_ldisc_release Jiri Slaby
2021-09-14 9:11 ` [PATCH 02/16] tty: remove flags from struct tty_ldisc_ops Jiri Slaby
2021-09-14 9:11 ` [PATCH 03/16] tty: remove extern from functions in tty headers Jiri Slaby
2021-09-14 9:11 ` Jiri Slaby [this message]
2021-09-15 8:05 ` [PATCH 04/16] tty: make tty_ldisc_ops::hangup return void Marc Kleine-Budde
2021-09-15 11:48 ` Mark Brown
2021-09-21 3:59 ` Dmitry Torokhov
2021-09-14 9:11 ` [PATCH 05/16] tty: remove file from tty_mode_ioctl Jiri Slaby
2021-09-15 8:05 ` Marc Kleine-Budde
2021-09-14 9:11 ` [PATCH 06/16] tty: remove file from n_tty_ioctl_helper Jiri Slaby
2021-09-14 9:15 ` Krzysztof Kozlowski
2021-09-14 9:11 ` [PATCH 07/16] tty: remove file from tty_ldisc_ops::ioctl and compat_ioctl Jiri Slaby
2021-09-14 9:16 ` Krzysztof Kozlowski
2021-09-15 8:02 ` Marc Kleine-Budde
2021-09-21 4:00 ` Dmitry Torokhov
2021-09-21 10:52 ` Jiri Slaby
2021-09-21 11:36 ` Greg KH
2021-09-21 15:51 ` Jiri Slaby
2021-09-22 15:01 ` Greg KH
2021-09-14 9:14 ` [PATCH 08/16] tty: drivers/tty/serial/, stop using tty_flip_buffer_push Jiri Slaby
2021-09-14 9:14 ` [PATCH 09/16] tty: drivers/tty/, " Jiri Slaby
2021-09-14 16:06 ` David Sterba
2021-09-14 9:14 ` [PATCH 10/16] tty: drivers/usb/serial/, " Jiri Slaby
2021-09-14 9:14 ` [PATCH 11/16] tty: drivers/usb/, " Jiri Slaby
2021-09-14 9:14 ` [PATCH 12/16] tty: arch/, " Jiri Slaby
2021-09-15 8:10 ` Max Filippov
2021-09-14 9:14 ` [PATCH 13/16] tty: drivers/s390/char/, " Jiri Slaby
2021-09-14 9:14 ` [PATCH 14/16] tty: drivers/staging/, " Jiri Slaby
2021-09-14 13:19 ` [greybus-dev] " Alex Elder
2021-09-14 9:14 ` [PATCH 15/16] tty: the rest, " Jiri Slaby
2021-09-14 11:58 ` Samuel Iglesias Gonsálvez
2021-09-14 9:14 ` [PATCH 16/16] tty: drop tty_flip_buffer_push Jiri Slaby
2021-09-16 10:03 ` Johan Hovold
2021-09-22 6:57 ` Jiri Slaby
2021-09-23 8:32 ` Johan Hovold
2021-11-18 7:54 ` Jiri Slaby
2021-11-18 8:10 ` Johan Hovold
2021-09-14 9:17 ` [PATCH 08/16] tty: drivers/tty/serial/, stop using tty_flip_buffer_push Krzysztof Kozlowski
2021-09-14 12:54 ` Uwe Kleine-König
2021-09-14 13:53 ` Richard Genoud
2021-09-15 17:00 ` Tobias Klauser
2021-09-15 17:53 ` Andreas Färber
2021-09-15 23:43 ` Andrew Jeffery
2021-09-16 7:13 ` Nicolas Ferre
2021-09-16 7:32 ` Chunyan Zhang
2021-09-16 7:48 ` Neil Armstrong
2021-09-16 12:54 ` Russell King (Oracle)
2021-09-16 20:30 ` Vladimir Zapolskiy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210914091134.17426-4-jslaby@suse.cz \
--to=jslaby@suse.cz \
--cc=broonie@kernel.org \
--cc=davem@davemloft.net \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=kuba@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=mkl@pengutronix.de \
--cc=paulus@samba.org \
--cc=perex@perex.cz \
--cc=peter.ujfalusi@gmail.com \
--cc=tiwai@suse.com \
--cc=wg@grandegger.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).