Skip to content

Commit

Permalink
serial: sc16is7xx: unconditionally clear line bit in sc16is7xx_remove()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Hugo Villeneuve authored and Greg Kroah-Hartman committed Apr 11, 2024
1 parent 2a8e4ab commit 7f33574
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/tty/serial/sc16is7xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 7f33574

Please sign in to comment.