All of lore.kernel.org
 help / color / mirror / Atom feed
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>, Chris Zankel <chris@zankel.net>,
	Max Filippov <jcmvbkbc@gmail.com>,
	linux-xtensa@linux-xtensa.org, Jiri Kosina <jikos@kernel.org>,
	David Sterba <dsterba@suse.com>
Subject: [PATCH 34/44] tty: do not check tty_unregister_driver's return value
Date: Tue,  2 Mar 2021 07:22:04 +0100	[thread overview]
Message-ID: <20210302062214.29627-34-jslaby@suse.cz> (raw)
In-Reply-To: <20210302062214.29627-1-jslaby@suse.cz>

These drivers check tty_unregister_driver return value. But they don't
handle a failure correctly (they free the driver in any case). So stop
checking tty_unregister_driver return value and remove also the prints.

In the next patch, tty_unregister_driver's return type will be switched
to void.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Cc: Chris Zankel <chris@zankel.net>
Cc: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-xtensa@linux-xtensa.org
Cc: Jiri Kosina <jikos@kernel.org>
Cc: David Sterba <dsterba@suse.com>
---
 arch/xtensa/platforms/iss/console.c | 6 +-----
 drivers/tty/amiserial.c             | 8 ++------
 drivers/tty/ipwireless/tty.c        | 7 +------
 drivers/tty/moxa.c                  | 4 +---
 drivers/tty/serial/kgdb_nmi.c       | 4 +---
 drivers/tty/synclink_gt.c           | 5 +----
 6 files changed, 7 insertions(+), 27 deletions(-)

diff --git a/arch/xtensa/platforms/iss/console.c b/arch/xtensa/platforms/iss/console.c
index 1e215cf5ad03..a3dda25a4e45 100644
--- a/arch/xtensa/platforms/iss/console.c
+++ b/arch/xtensa/platforms/iss/console.c
@@ -171,11 +171,7 @@ static int __init rs_init(void)
 
 static __exit void rs_exit(void)
 {
-	int error;
-
-	if ((error = tty_unregister_driver(serial_driver)))
-		pr_err("ISS_SERIAL: failed to unregister serial driver (%d)\n",
-		       error);
+	tty_unregister_driver(serial_driver);
 	put_tty_driver(serial_driver);
 	tty_port_destroy(&serial_port);
 }
diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
index 18b78ea110ef..0c8157fab17f 100644
--- a/drivers/tty/amiserial.c
+++ b/drivers/tty/amiserial.c
@@ -1622,21 +1622,17 @@ static int __init amiga_serial_probe(struct platform_device *pdev)
 
 static int __exit amiga_serial_remove(struct platform_device *pdev)
 {
-	int error;
 	struct serial_state *state = platform_get_drvdata(pdev);
 
 	/* printk("Unloading %s: version %s\n", serial_name, serial_version); */
-	error = tty_unregister_driver(serial_driver);
-	if (error)
-		printk("SERIAL: failed to unregister serial driver (%d)\n",
-		       error);
+	tty_unregister_driver(serial_driver);
 	put_tty_driver(serial_driver);
 	tty_port_destroy(&state->tport);
 
 	free_irq(IRQ_AMIGA_TBE, state);
 	free_irq(IRQ_AMIGA_RBF, state);
 
-	return error;
+	return 0;
 }
 
 static struct platform_driver amiga_serial_driver = {
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
index 6dacbc5e286c..1836746991b5 100644
--- a/drivers/tty/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -596,13 +596,8 @@ int ipwireless_tty_init(void)
 
 void ipwireless_tty_release(void)
 {
-	int ret;
-
-	ret = tty_unregister_driver(ipw_tty_driver);
+	tty_unregister_driver(ipw_tty_driver);
 	put_tty_driver(ipw_tty_driver);
-	if (ret != 0)
-		printk(KERN_ERR IPWIRELESS_PCCARD_NAME
-			": tty_unregister_driver failed with code %d\n", ret);
 }
 
 int ipwireless_tty_is_modem(struct ipw_tty *tty)
diff --git a/drivers/tty/moxa.c b/drivers/tty/moxa.c
index 9f13f7d49dd7..32eb6b5e510f 100644
--- a/drivers/tty/moxa.c
+++ b/drivers/tty/moxa.c
@@ -1118,9 +1118,7 @@ static void __exit moxa_exit(void)
 
 	del_timer_sync(&moxaTimer);
 
-	if (tty_unregister_driver(moxaDriver))
-		printk(KERN_ERR "Couldn't unregister MOXA Intellio family "
-				"serial driver\n");
+	tty_unregister_driver(moxaDriver);
 	put_tty_driver(moxaDriver);
 }
 
diff --git a/drivers/tty/serial/kgdb_nmi.c b/drivers/tty/serial/kgdb_nmi.c
index 6004c0c1d173..db059b66438e 100644
--- a/drivers/tty/serial/kgdb_nmi.c
+++ b/drivers/tty/serial/kgdb_nmi.c
@@ -373,9 +373,7 @@ int kgdb_unregister_nmi_console(void)
 	if (ret)
 		return ret;
 
-	ret = tty_unregister_driver(kgdb_nmi_tty_driver);
-	if (ret)
-		return ret;
+	tty_unregister_driver(kgdb_nmi_tty_driver);
 	put_tty_driver(kgdb_nmi_tty_driver);
 
 	return 0;
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index 644173786bf0..4727a41158b0 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -3705,7 +3705,6 @@ static const struct tty_operations ops = {
 
 static void slgt_cleanup(void)
 {
-	int rc;
 	struct slgt_info *info;
 	struct slgt_info *tmp;
 
@@ -3714,9 +3713,7 @@ static void slgt_cleanup(void)
 	if (serial_driver) {
 		for (info=slgt_device_list ; info != NULL ; info=info->next_device)
 			tty_unregister_device(serial_driver, info->line);
-		rc = tty_unregister_driver(serial_driver);
-		if (rc)
-			DBGERR(("tty_unregister_driver error=%d\n", rc));
+		tty_unregister_driver(serial_driver);
 		put_tty_driver(serial_driver);
 	}
 
-- 
2.30.1


  parent reply	other threads:[~2021-03-02  8:26 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02  6:21 [PATCH 01/44] MAINTAINERS: orphan mxser Jiri Slaby
2021-03-02  6:21 ` [PATCH 02/44] MAINTAINERS: drop cyclades.com reference Jiri Slaby
2021-03-02  6:21 ` [PATCH 03/44] PCI: remove synclink entries from pci_ids Jiri Slaby
2021-03-06 23:47   ` Krzysztof Wilczyński
2021-03-12 22:12   ` Bjorn Helgaas
2021-03-02  6:21 ` [PATCH 04/44] vgacon: comment on vga_rolled_over Jiri Slaby
2021-03-02  6:21   ` Jiri Slaby
2021-03-11 13:08   ` Daniel Vetter
2021-03-11 13:08     ` Daniel Vetter
2021-03-02  6:21 ` [PATCH 05/44] tty: cyclades, remove this orphan Jiri Slaby
2021-03-02  6:21 ` [PATCH 06/44] tty: isicom, " Jiri Slaby
2021-03-02  6:21 ` [PATCH 07/44] tty: rocket, remove the driver Jiri Slaby
2021-03-02  6:21 ` [PATCH 08/44] tty: remove TTY_LDISC_MAGIC Jiri Slaby
2021-03-02  6:21 ` [PATCH 09/44] tty: n_tty, set tty_ldisc_ops::owner Jiri Slaby
2021-03-02  6:21 ` [PATCH 10/44] tty: imx, use ms_to_ktime Jiri Slaby
2021-03-02  6:59   ` Uwe Kleine-König
2021-03-02  6:21 ` [PATCH 11/44] tty: 8250, " Jiri Slaby
2021-03-02  6:21 ` [PATCH 12/44] tty: 8250, cleanup em485 timers Jiri Slaby
2021-03-02  6:21 ` [PATCH 13/44] tty: 8250/serial_cs, propagate errors in simple_config Jiri Slaby
2021-03-02  6:21 ` [PATCH 14/44] net: caif: inline register_ldisc Jiri Slaby
2021-03-02  6:21 ` [PATCH 15/44] net: nfc: nci: remove memset of nci_uart_drivers Jiri Slaby
2021-03-02  6:21 ` [PATCH 16/44] net: nfc: nci: drop nci_uart_ops::recv_buf Jiri Slaby
2021-03-02  6:21 ` [PATCH 17/44] net: nfc: nci: drop nci_uart_default_recv Jiri Slaby
2021-03-02  6:21 ` [PATCH 18/44] tty: con3215, remove tasklet for tty_wakeup Jiri Slaby
2021-03-02  6:21 ` [PATCH 19/44] tty: con3215, remove unneeded tty checks Jiri Slaby
2021-03-02  6:21 ` [PATCH 20/44] tty: con3215, remove tty->driver_data casts Jiri Slaby
2021-03-02  6:21 ` [PATCH 21/44] tty: jsm_tty, make char+error handling readable Jiri Slaby
2021-03-02  6:21 ` [PATCH 22/44] tty: nozomi, remove struct buffer Jiri Slaby
2021-03-02  6:21 ` [PATCH 23/44] tty: nozomi, remove init/exit messages Jiri Slaby
2021-03-02  6:21 ` [PATCH 24/44] tty: nozomi, remove useless debug prints Jiri Slaby
2021-03-02  6:21 ` [PATCH 25/44] tty: vcc, make globals static Jiri Slaby
2021-03-02  6:21 ` [PATCH 26/44] tty: vcc, drop version dump Jiri Slaby
2021-03-02  6:21   ` Jiri Slaby
2021-03-02  6:21 ` [PATCH 27/44] tty: vcc, use name strings directly Jiri Slaby
2021-03-02  6:21   ` Jiri Slaby
2021-03-02  6:21 ` [PATCH 28/44] tty: vcc, remove useless tty checks Jiri Slaby
2021-03-02  6:21   ` Jiri Slaby
2021-03-02  6:21 ` [PATCH 29/44] tty: xtensa/iss, drop serial_version & serial_name Jiri Slaby
2021-03-02  6:45   ` Max Filippov
2021-03-02  6:22 ` [PATCH 30/44] tty: xtensa/iss, don't reassign to tty->port Jiri Slaby
2021-03-02  7:12   ` Max Filippov
2021-03-02  6:22 ` [PATCH 31/44] tty: xtensa/iss, remove stale comments Jiri Slaby
2021-03-02  6:49   ` Max Filippov
2021-03-02  6:22 ` [PATCH 32/44] tty: xtensa/iss, setup the timer statically Jiri Slaby
2021-03-02  6:52   ` Max Filippov
2021-03-02  6:22 ` [PATCH 33/44] tty: xtensa/iss, make rs_init static Jiri Slaby
2021-03-02  6:55   ` Max Filippov
2021-03-02  6:22 ` Jiri Slaby [this message]
2021-03-02  6:57   ` [PATCH 34/44] tty: do not check tty_unregister_driver's return value Max Filippov
2021-03-02 11:14   ` David Sterba
2021-03-02  6:22 ` [PATCH 35/44] tty: let tty_unregister_driver return void Jiri Slaby
2021-03-02  6:22 ` [PATCH 36/44] tty: localise ptychar and make it const Jiri Slaby
2021-03-02  6:22 ` [PATCH 37/44] USB: serial/keyspan, drop unneeded forward declarations Jiri Slaby
2021-03-03 19:17   ` Greg KH
2021-03-05 10:10     ` Johan Hovold
2021-03-15  8:43     ` Johan Hovold
2021-03-02  6:22 ` [PATCH 38/44] USB: serial/io_edgeport, " Jiri Slaby
2021-03-03 19:17   ` Greg KH
2021-03-02  6:22 ` [PATCH 39/44] tty: synclink_gt, " Jiri Slaby
2021-03-02  6:22 ` [PATCH 40/44] tty: hvc, " Jiri Slaby
2021-03-02  6:22   ` Jiri Slaby
2021-03-02 19:09   ` Tyrel Datwyler
2021-03-03  7:44   ` Uwe Kleine-König
2021-03-03  7:44     ` Uwe Kleine-König
2021-03-02  6:22 ` [PATCH 41/44] tty: n_gsm, remove duplicates of parameters Jiri Slaby
2021-03-02  6:22 ` [PATCH 42/44] tty: cleanup tty_chars_in_buffer Jiri Slaby
2021-03-02  6:22 ` [PATCH 43/44] tty: make everyone's chars_in_buffer return >= 0 Jiri Slaby
2021-03-02  6:22 ` [PATCH 44/44] tty: make everyone's write_room " Jiri Slaby
2021-03-05 10:18   ` Johan Hovold
2021-03-03 19:19 ` [PATCH 01/44] MAINTAINERS: orphan mxser Greg KH

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=20210302062214.29627-34-jslaby@suse.cz \
    --to=jslaby@suse.cz \
    --cc=chris@zankel.net \
    --cc=dsterba@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jcmvbkbc@gmail.com \
    --cc=jikos@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.