diff options
Diffstat (limited to 'drivers/tty/serial/kgdboc.c')
-rw-r--r-- | drivers/tty/serial/kgdboc.c | 15 |
1 files changed, 2 insertions, 13 deletions
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index 10020547c60..87e7e6c876d 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/console.h> | 19 | #include <linux/console.h> |
20 | #include <linux/vt_kern.h> | 20 | #include <linux/vt_kern.h> |
21 | #include <linux/input.h> | 21 | #include <linux/input.h> |
22 | #include <linux/module.h> | ||
23 | 22 | ||
24 | #define MAX_CONFIG_LEN 40 | 23 | #define MAX_CONFIG_LEN 40 |
25 | 24 | ||
@@ -97,8 +96,7 @@ static void kgdboc_restore_input(void) | |||
97 | 96 | ||
98 | static int kgdboc_register_kbd(char **cptr) | 97 | static int kgdboc_register_kbd(char **cptr) |
99 | { | 98 | { |
100 | if (strncmp(*cptr, "kbd", 3) == 0 || | 99 | if (strncmp(*cptr, "kbd", 3) == 0) { |
101 | strncmp(*cptr, "kdb", 3) == 0) { | ||
102 | if (kdb_poll_idx < KDB_POLL_FUNC_MAX) { | 100 | if (kdb_poll_idx < KDB_POLL_FUNC_MAX) { |
103 | kdb_poll_funcs[kdb_poll_idx] = kdb_get_kbd_char; | 101 | kdb_poll_funcs[kdb_poll_idx] = kdb_get_kbd_char; |
104 | kdb_poll_idx++; | 102 | kdb_poll_idx++; |
@@ -123,7 +121,7 @@ static void kgdboc_unregister_kbd(void) | |||
123 | i--; | 121 | i--; |
124 | } | 122 | } |
125 | } | 123 | } |
126 | flush_work(&kgdboc_restore_input_work); | 124 | flush_work_sync(&kgdboc_restore_input_work); |
127 | } | 125 | } |
128 | #else /* ! CONFIG_KDB_KEYBOARD */ | 126 | #else /* ! CONFIG_KDB_KEYBOARD */ |
129 | #define kgdboc_register_kbd(x) 0 | 127 | #define kgdboc_register_kbd(x) 0 |
@@ -146,8 +144,6 @@ __setup("kgdboc=", kgdboc_option_setup); | |||
146 | 144 | ||
147 | static void cleanup_kgdboc(void) | 145 | static void cleanup_kgdboc(void) |
148 | { | 146 | { |
149 | if (kgdb_unregister_nmi_console()) | ||
150 | return; | ||
151 | kgdboc_unregister_kbd(); | 147 | kgdboc_unregister_kbd(); |
152 | if (configured == 1) | 148 | if (configured == 1) |
153 | kgdb_unregister_io_module(&kgdboc_io_ops); | 149 | kgdb_unregister_io_module(&kgdboc_io_ops); |
@@ -201,18 +197,11 @@ do_register: | |||
201 | if (err) | 197 | if (err) |
202 | goto noconfig; | 198 | goto noconfig; |
203 | 199 | ||
204 | err = kgdb_register_nmi_console(); | ||
205 | if (err) | ||
206 | goto nmi_con_failed; | ||
207 | |||
208 | configured = 1; | 200 | configured = 1; |
209 | 201 | ||
210 | return 0; | 202 | return 0; |
211 | 203 | ||
212 | nmi_con_failed: | ||
213 | kgdb_unregister_io_module(&kgdboc_io_ops); | ||
214 | noconfig: | 204 | noconfig: |
215 | kgdboc_unregister_kbd(); | ||
216 | config[0] = 0; | 205 | config[0] = 0; |
217 | configured = 0; | 206 | configured = 0; |
218 | cleanup_kgdboc(); | 207 | cleanup_kgdboc(); |