Skip to content

Commit 543a5af

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
serial: 8250: document doubled "type == PORT_8250_CIR" check
The check for "port.type == PORT_8250_CIR" is present twice in serial8250_register_8250_port(). The latter was already tried to be dropped by 1104321 ("serial: Delete dead code for CIR serial ports") and then reverted by 9527b82 ("Revert "serial: Delete dead code for CIR serial ports""). Document this weirdness with a reason. Signed-off-by: "Jiri Slaby (SUSE)" <[email protected]> Suggested-by: Andy Shevchenko <[email protected]> Acked-by: Andy Shevchenko <[email protected]> Cc: "Maciej S. Szmigiero" <[email protected]> Link: https://lore.kernel.org/all/[email protected]/ Reviewed-by: Ilpo Järvinen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 2721fc7 commit 543a5af

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/tty/serial/8250/8250_core.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -717,6 +717,7 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
717717
nr_uarts++;
718718
}
719719

720+
/* Check if it is CIR already. We check this below again, see there why. */
720721
if (uart->port.type == PORT_8250_CIR) {
721722
ret = -ENODEV;
722723
goto unlock;
@@ -815,6 +816,7 @@ int serial8250_register_8250_port(const struct uart_8250_port *up)
815816
if (up->dl_write)
816817
uart->dl_write = up->dl_write;
817818

819+
/* Check the type (again)! It might have changed by the port.type assignment above. */
818820
if (uart->port.type != PORT_8250_CIR) {
819821
if (uart_console_registered(&uart->port))
820822
pm_runtime_get_sync(uart->port.dev);

0 commit comments

Comments
 (0)