TTY: serial/mpsc, clean up init/remove functions
authorJiri Slaby <jslaby@suse.cz>
Tue, 12 Jan 2016 09:49:33 +0000 (10:49 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 7 Feb 2016 06:16:21 +0000 (22:16 -0800)
commitbca1481ec4a0014271b7c220f41d7a790654dfbb
treeb2f8dd7915084024ad2a5fd5ba3ee636d301f28c
parent1fba6a594cfd1ea0f1fc8a97e22f43def1505d74
TTY: serial/mpsc, clean up init/remove functions

There is a chain of up to 4 nested ifs in init and remove functions.
Instead, make the code linear and use goto's to handle failures.

Remove unneeded cast from mpsc_release_port by referencing pi->port
directly. And finally, use dev_dbg instead of pr_debug given we have
dev->dev node.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/mpsc.c