diff options
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/serial/kgdboc.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/serial/kgdboc.c b/drivers/serial/kgdboc.c index ecef6e1a599a..b765ab48dfe7 100644 --- a/drivers/serial/kgdboc.c +++ b/drivers/serial/kgdboc.c | |||
| @@ -16,6 +16,7 @@ | |||
| 16 | #include <linux/kgdb.h> | 16 | #include <linux/kgdb.h> |
| 17 | #include <linux/kdb.h> | 17 | #include <linux/kdb.h> |
| 18 | #include <linux/tty.h> | 18 | #include <linux/tty.h> |
| 19 | #include <linux/console.h> | ||
| 19 | 20 | ||
| 20 | #define MAX_CONFIG_LEN 40 | 21 | #define MAX_CONFIG_LEN 40 |
| 21 | 22 | ||
| @@ -93,12 +94,14 @@ static int configure_kgdboc(void) | |||
| 93 | int tty_line = 0; | 94 | int tty_line = 0; |
| 94 | int err; | 95 | int err; |
| 95 | char *cptr = config; | 96 | char *cptr = config; |
| 97 | struct console *cons; | ||
| 96 | 98 | ||
| 97 | err = kgdboc_option_setup(config); | 99 | err = kgdboc_option_setup(config); |
| 98 | if (err || !strlen(config) || isspace(config[0])) | 100 | if (err || !strlen(config) || isspace(config[0])) |
| 99 | goto noconfig; | 101 | goto noconfig; |
| 100 | 102 | ||
| 101 | err = -ENODEV; | 103 | err = -ENODEV; |
| 104 | kgdboc_io_ops.is_console = 0; | ||
| 102 | kgdb_tty_driver = NULL; | 105 | kgdb_tty_driver = NULL; |
| 103 | 106 | ||
| 104 | if (kgdboc_register_kbd(&cptr)) | 107 | if (kgdboc_register_kbd(&cptr)) |
| @@ -108,6 +111,17 @@ static int configure_kgdboc(void) | |||
| 108 | if (!p) | 111 | if (!p) |
| 109 | goto noconfig; | 112 | goto noconfig; |
| 110 | 113 | ||
| 114 | cons = console_drivers; | ||
| 115 | while (cons) { | ||
| 116 | int idx; | ||
| 117 | if (cons->device && cons->device(cons, &idx) == p && | ||
| 118 | idx == tty_line) { | ||
| 119 | kgdboc_io_ops.is_console = 1; | ||
| 120 | break; | ||
| 121 | } | ||
| 122 | cons = cons->next; | ||
| 123 | } | ||
| 124 | |||
| 111 | kgdb_tty_driver = p; | 125 | kgdb_tty_driver = p; |
| 112 | kgdb_tty_line = tty_line; | 126 | kgdb_tty_line = tty_line; |
| 113 | 127 | ||
