Skip to content

Commit 9527b82

Browse files
seanyounggregkh
authored andcommitted
Revert "serial: Delete dead code for CIR serial ports"
This reverts commit 1104321. The code is not dead at all and breaks winbond-cir. Serial: 8250/16550 driver, 32 ports, IRQ sharing enabled 00:02: ttyS0 at I/O 0x3f8 (irq = 4, base_baud = 115200) is a 16550A 00:03: ttyS1 at I/O 0x2f8 (irq = 3, base_baud = 115200) is a CIR port lirc lirc0: lirc_dev: driver ir-lirc-codec (winbond-cir) registered at minor = 0 winbond-cir 00:03: Region 0x2f8-0x2ff already in use! winbond-cir: probe of 00:03 failed with error -16 Signed-off-by: Sean Young <[email protected]> Reviewed-by: Matthias Brugger <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 37ef38f commit 9527b82

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

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

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,13 +1043,24 @@ int serial8250_register_8250_port(struct uart_8250_port *up)
10431043
if (up->dl_write)
10441044
uart->dl_write = up->dl_write;
10451045

1046-
if (serial8250_isa_config != NULL)
1047-
serial8250_isa_config(0, &uart->port,
1048-
&uart->capabilities);
1046+
if (uart->port.type != PORT_8250_CIR) {
1047+
if (serial8250_isa_config != NULL)
1048+
serial8250_isa_config(0, &uart->port,
1049+
&uart->capabilities);
1050+
1051+
ret = uart_add_one_port(&serial8250_reg,
1052+
&uart->port);
1053+
if (ret == 0)
1054+
ret = uart->port.line;
1055+
} else {
1056+
dev_info(uart->port.dev,
1057+
"skipping CIR port at 0x%lx / 0x%llx, IRQ %d\n",
1058+
uart->port.iobase,
1059+
(unsigned long long)uart->port.mapbase,
1060+
uart->port.irq);
10491061

1050-
ret = uart_add_one_port(&serial8250_reg, &uart->port);
1051-
if (ret == 0)
1052-
ret = uart->port.line;
1062+
ret = 0;
1063+
}
10531064
}
10541065
mutex_unlock(&serial_mutex);
10551066

0 commit comments

Comments
 (0)