serial: max310x: simplify probe() and remove() error handling
authorHugo Villeneuve <hvilleneuve@dimonoff.com>
Thu, 18 Jan 2024 15:22:05 +0000 (10:22 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 28 Jan 2024 03:05:04 +0000 (19:05 -0800)
commit5d888f1c32e2281843d58eef963e3ebd625b77a9
tree594df7640ab7a633a2eb6ffa94d82098f82140b7
parent609aabb259d497578ffa2d66ced57c22044f821c
serial: max310x: simplify probe() and remove() error handling

Simplify error handling and only call uart_remove_one_port() if line bit
is set, instead of having to manually set s->p[i].port.dev to NULL.

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
Link: https://lore.kernel.org/r/20240118152213.2644269-10-hugo@hugovil.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/max310x.c