summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Villeneuve <hvilleneuve@dimonoff.com>2024-04-09 18:42:50 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-04-11 15:08:08 +0300
commit7f335744817092112be68efc06404466c135ae52 (patch)
tree3a44600e5378cb0d9cd0b01c7fbe4f2e2e70391c
parent2a8e4ab0c93fad30769479f86849e22d63cd0e12 (diff)
downloadlinux-7f335744817092112be68efc06404466c135ae52.tar.xz
serial: sc16is7xx: unconditionally clear line bit in sc16is7xx_remove()
There is no need to check for previous port registration in sc16is7xx_remove() because if sc16is7xx_probe() succeeded, we are guaranteed to have successfully registered both ports. We can thus unconditionally clear the line allocation bit in sc16is7xx_lines. Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com> Reviewed-by: Andy Shevchenko <andy@kernel.org> Link: https://lore.kernel.org/r/20240409154253.3043822-3-hugo@hugovil.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/tty/serial/sc16is7xx.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index afcfb4f38945..a134cd2a931d 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1660,8 +1660,8 @@ static void sc16is7xx_remove(struct device *dev)
for (i = 0; i < s->devtype->nr_uart; i++) {
kthread_cancel_delayed_work_sync(&s->p[i].ms_work);
- if (test_and_clear_bit(s->p[i].port.line, sc16is7xx_lines))
- uart_remove_one_port(&sc16is7xx_uart, &s->p[i].port);
+ clear_bit(s->p[i].port.line, sc16is7xx_lines);
+ uart_remove_one_port(&sc16is7xx_uart, &s->p[i].port);
sc16is7xx_power(&s->p[i].port, 0);
}