[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240409154253.3043822-3-hugo@hugovil.com>
Date: Tue, 9 Apr 2024 11:42:50 -0400
From: Hugo Villeneuve <hugo@...ovil.com>
To: gregkh@...uxfoundation.org,
jirislaby@...nel.org,
peterz@...radead.org,
mingo@...nel.org
Cc: linux-kernel@...r.kernel.org,
linux-serial@...r.kernel.org,
hugo@...ovil.com,
andy.shevchenko@...il.com,
Hugo Villeneuve <hvilleneuve@...onoff.com>,
Andy Shevchenko <andy@...nel.org>
Subject: [PATCH v4 2/5] serial: sc16is7xx: unconditionally clear line bit in sc16is7xx_remove()
From: Hugo Villeneuve <hvilleneuve@...onoff.com>
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@...onoff.com>
Reviewed-by: Andy Shevchenko <andy@...nel.org>
---
drivers/tty/serial/sc16is7xx.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index 34edc80859d5c..b971fd2a9a77e 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1670,8 +1670,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);
}
--
2.39.2
Powered by blists - more mailing lists