aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorKalle Pokki <kalle.pokki@iki.fi>2006-11-01 08:08:13 -0500
committerPaul Mackerras <paulus@samba.org>2006-11-10 05:35:36 -0500
commit0091cf5a6ae6e52fc95ceb53200975ef2c81c206 (patch)
tree374a45649cff6bf799541bbfc602097c843f5b36 /drivers
parent599540a85595bd5950354bd95f5ebf9c6e07c971 (diff)
[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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/serial/cpm_uart/cpm_uart.h2
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_core.c11
-rw-r--r--drivers/serial/cpm_uart/cpm_uart_cpm1.c2
3 files changed, 8 insertions, 7 deletions
diff --git a/drivers/serial/cpm_uart/cpm_uart.h b/drivers/serial/cpm_uart/cpm_uart.h
index a8f894c78194..69715e556506 100644
--- a/drivers/serial/cpm_uart/cpm_uart.h
+++ b/drivers/serial/cpm_uart/cpm_uart.h
@@ -88,7 +88,7 @@ extern struct uart_cpm_port cpm_uart_ports[UART_NR];
88 88
89/* these are located in their respective files */ 89/* these are located in their respective files */
90void cpm_line_cr_cmd(int line, int cmd); 90void cpm_line_cr_cmd(int line, int cmd);
91int cpm_uart_init_portdesc(void); 91int __init cpm_uart_init_portdesc(void);
92int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con); 92int cpm_uart_allocbuf(struct uart_cpm_port *pinfo, unsigned int is_con);
93void cpm_uart_freebuf(struct uart_cpm_port *pinfo); 93void cpm_uart_freebuf(struct uart_cpm_port *pinfo);
94 94
diff --git a/drivers/serial/cpm_uart/cpm_uart_core.c b/drivers/serial/cpm_uart/cpm_uart_core.c
index 32fd8c83bd8e..7a3b97fdf8d1 100644
--- a/drivers/serial/cpm_uart/cpm_uart_core.c
+++ b/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -1349,11 +1349,10 @@ static int cpm_uart_init(void) {
1349 pr_info("cpm_uart: WARNING: no UART devices found on platform bus!\n"); 1349 pr_info("cpm_uart: WARNING: no UART devices found on platform bus!\n");
1350 pr_info( 1350 pr_info(
1351 "cpm_uart: the driver will guess configuration, but this mode is no longer supported.\n"); 1351 "cpm_uart: the driver will guess configuration, but this mode is no longer supported.\n");
1352#ifndef CONFIG_SERIAL_CPM_CONSOLE 1352
1353 ret = cpm_uart_init_portdesc(); 1353 /* Don't run this again, if the console driver did it already */
1354 if (ret) 1354 if (cpm_uart_nr == 0)
1355 return ret; 1355 cpm_uart_init_portdesc();
1356#endif
1357 1356
1358 cpm_reg.nr = cpm_uart_nr; 1357 cpm_reg.nr = cpm_uart_nr;
1359 ret = uart_register_driver(&cpm_reg); 1358 ret = uart_register_driver(&cpm_reg);
@@ -1365,6 +1364,8 @@ static int cpm_uart_init(void) {
1365 int con = cpm_uart_port_map[i]; 1364 int con = cpm_uart_port_map[i];
1366 cpm_uart_ports[con].port.line = i; 1365 cpm_uart_ports[con].port.line = i;
1367 cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF; 1366 cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF;
1367 if (cpm_uart_ports[con].set_lineif)
1368 cpm_uart_ports[con].set_lineif(&cpm_uart_ports[con]);
1368 uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port); 1369 uart_add_one_port(&cpm_reg, &cpm_uart_ports[con].port);
1369 } 1370 }
1370 1371
diff --git a/drivers/serial/cpm_uart/cpm_uart_cpm1.c b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
index 95afc37297a8..08e55fdc882a 100644
--- a/drivers/serial/cpm_uart/cpm_uart_cpm1.c
+++ b/drivers/serial/cpm_uart/cpm_uart_cpm1.c
@@ -184,7 +184,7 @@ void cpm_uart_freebuf(struct uart_cpm_port *pinfo)
184} 184}
185 185
186/* Setup any dynamic params in the uart desc */ 186/* Setup any dynamic params in the uart desc */
187int cpm_uart_init_portdesc(void) 187int __init cpm_uart_init_portdesc(void)
188{ 188{
189 pr_debug("CPM uart[-]:init portdesc\n"); 189 pr_debug("CPM uart[-]:init portdesc\n");
190 190