Add checks for CPM UART being used by KGDB to the console setup() and driver
probe() methods -- previously it was only in the "legacy mode" path of the
module_init() function. Also, properly indent the related code in that path...

Extracted/modified from the original patch by Yuri Shpilevsky.

Signed-off-by: Yuri Shpilevsky <[EMAIL PROTECTED]>
Signed-off-by: Sergei Shtylyov <[EMAIL PROTECTED]>

---
Here's some change that I've missed the last time.
The patch is against the linux_2_6_21_uprev branch as usual...

 drivers/serial/cpm_uart/cpm_uart_core.c |   18 +++++++++++++++---
 1 files changed, 15 insertions(+), 3 deletions(-)

Index: linux-2.6/drivers/serial/cpm_uart/cpm_uart_core.c
===================================================================
--- linux-2.6.orig/drivers/serial/cpm_uart/cpm_uart_core.c
+++ linux-2.6/drivers/serial/cpm_uart/cpm_uart_core.c
@@ -1226,6 +1226,12 @@ static int __init cpm_uart_console_setup
        int flow = 'n';
        int ret;
 
+#ifdef CONFIG_KGDB_CPM_UART
+       /* We are not interested in ports yet utilized by kgdb */
+       if (co->index == KGDB_PINFO_INDEX)
+               return 0;
+#endif
+
        port =
            (struct uart_port *)&cpm_uart_ports[cpm_uart_port_map[co->index]];
        pinfo = (struct uart_cpm_port *)port;
@@ -1296,6 +1302,12 @@ static int cpm_uart_drv_probe(struct dev
 
        pdata = pdev->dev.platform_data;
 
+#ifdef CONFIG_KGDB_CPM_UART
+       /* We are not interested in ports yet utilized by kgdb */
+       if (cpm_uart_id2nr(fs_uart_get_id(pdata)) == KGDB_PINFO_INDEX)
+               return ret;
+#endif
+
        if ((ret = cpm_uart_drv_get_platform_data(pdev, 0)))
                return ret;
 
@@ -1395,9 +1407,9 @@ static int cpm_uart_init(void) {
                        int con = cpm_uart_port_map[i];
 
 #ifdef CONFIG_KGDB_CPM_UART
-               /* We are not interested in ports yet utilized by kgdb */
-               if(con == KGDB_PINFO_INDEX)
-                       continue;
+                       /* We are not interested in ports yet utilized by kgdb 
*/
+                       if (con == KGDB_PINFO_INDEX)
+                               continue;
 #endif
                        cpm_uart_ports[con].port.line = i;
                        cpm_uart_ports[con].port.flags = UPF_BOOT_AUTOCONF;


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Kgdb-bugreport mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kgdb-bugreport

Reply via email to