[POWERPC] CPM_UART: Fix non-console initialisation

The cpm_uart driver is initialised incorrectly, if there is a frame buffer
console, and CONFIG_SERIAL_CPM_CONSOLE is defined. The driver fails to
call cpm_uart_init_portdesc() and set_lineif() in this case.

Signed-off-by: Kalle Pokki <kalle.pokki@iki.fi>
Signed-off-by: Vitaly Bordug <vbordug@ru.mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by Kalle Pokki and committed by Paul Mackerras 0091cf5a 599540a8

+8 -7
+1 -1
drivers/serial/cpm_uart/cpm_uart.h
··· 88 88 89 89 /* these are located in their respective files */ 90 90 void cpm_line_cr_cmd(int line, int cmd); 91 - int cpm_uart_init_portdesc(void); 91 + int __init cpm_uart_init_portdesc(void); 92 92 int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con); 93 93 void cpm_uart_freebuf(struct uart_cpm_port *pinfo); 94 94
+6 -5
drivers/serial/cpm_uart/cpm_uart_core.c
··· 1349 1349 pr_info("cpm_uart: WARNING: no UART devices found on platform bus!\n"); 1350 1350 pr_info( 1351 1351 "cpm_uart: the driver will guess configuration, but this mode is no longer supported.\n"); 1352 - #ifndef CONFIG_SERIAL_CPM_CONSOLE 1353 - ret = cpm_uart_init_portdesc(); 1354 - if (ret) 1355 - return ret; 1356 - #endif 1352 + 1353 + /* Don't run this again, if the console driver did it already */ 1354 + if (cpm_uart_nr == 0) 1355 + cpm_uart_init_portdesc(); 1357 1356 1358 1357 cpm_reg.nr = cpm_uart_nr; 1359 1358 ret = uart_register_driver(&cpm_reg); ··· 1364 1365 int con = cpm_uart_port_map[i]; 1365 1366 cpm_uart_ports[con].port.line = i; 1366 1367 cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF; 1368 + if (cpm_uart_ports[con].set_lineif) 1369 + cpm_uart_ports[con].set_lineif(&cpm_uart_ports[con]); 1367 1370 uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port); 1368 1371 } 1369 1372
+1 -1
drivers/serial/cpm_uart/cpm_uart_cpm1.c
··· 184 184 } 185 185 186 186 /* Setup any dynamic params in the uart desc */ 187 - int cpm_uart_init_portdesc(void) 187 + int __init cpm_uart_init_portdesc(void) 188 188 { 189 189 pr_debug("CPM uart[-]:init portdesc\n"); 190 190