diff options
author | Jiri Slaby <jslaby@suse.cz> | 2021-03-02 09:22:04 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2021-03-10 11:34:09 +0300 |
commit | 6c2e6317c975c3cef1e08482a6ed8b734831ffbe (patch) | |
tree | 9229d440c0a9f38bbdbe6a94a3ab1c856d08ddde /drivers/tty/amiserial.c | |
parent | ba444ea3bc9377c0445990da1ce7d5eb33b099d8 (diff) |
tty: do not check tty_unregister_driver's return value
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.
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>
Reviewed-by: Max Filippov <jcmvbkbc@gmail.com>
Acked-by: David Sterba <dsterba@suse.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210302062214.29627-34-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/amiserial.c')
-rw-r--r-- | drivers/tty/amiserial.c | 8 |
1 files changed, 2 insertions, 6 deletions
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 @@ fail_put_tty_driver: 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 = { |