mxser: rework and simplify mxser_open
authorJiri Slaby <jslaby@suse.cz>
Fri, 18 Jun 2021 06:14:56 +0000 (08:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 18 Jun 2021 11:10:02 +0000 (13:10 +0200)
commit42ad25fc46d3f6b6fe5b4b933dd328677e328ec7
tree11d579bd8d2fd738fec66b52f19b830f5e415765
parentc3db20c3b71bf14d49e4a6582325e22db4e74a75
mxser: rework and simplify mxser_open

In mxser_open, tty->port is already set thanks to
tty_port_register_device in ->probe. So we can simply use container_of
to deduce the struct mxser_port's pointer. Thus avoiding divisions and
complex computations.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210618061516.662-51-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/mxser.c