diff options
author | Luka Pivk <luka.pivk@toradex.com> | 2018-12-10 07:13:48 +0100 |
---|---|---|
committer | Luka Pivk <luka.pivk@toradex.com> | 2018-12-10 07:13:48 +0100 |
commit | c6051ffcb824b7491419c6ac407b1a6d7756dcab (patch) | |
tree | 4f65a7a58c51679117534756bb3fbe2be1e7fb40 /drivers/tty | |
parent | b62d18524e9e96d0a5252048827523cd07fa2fc6 (diff) | |
parent | 178574b66509c9ff7df4ad26c84a8884567e93b4 (diff) |
Merge remote-tracking branch 'remotes/origin/linux-4.19.y'
Signed-off-by: Luka Pivk <luka.pivk@toradex.com>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/serial/kgdboc.c | 43 |
1 files changed, 21 insertions, 22 deletions
diff --git a/drivers/tty/serial/kgdboc.c b/drivers/tty/serial/kgdboc.c index f4d0ef695225..8a111ab33b50 100644 --- a/drivers/tty/serial/kgdboc.c +++ b/drivers/tty/serial/kgdboc.c @@ -128,24 +128,6 @@ static void kgdboc_unregister_kbd(void) #define kgdboc_restore_input() #endif /* ! CONFIG_KDB_KEYBOARD */ -static int kgdboc_option_setup(char *opt) -{ - if (!opt) { - pr_err("kgdboc: config string not provided\n"); - return -EINVAL; - } - - if (strlen(opt) >= MAX_CONFIG_LEN) { - printk(KERN_ERR "kgdboc: config string too long\n"); - return -ENOSPC; - } - strcpy(config, opt); - - return 0; -} - -__setup("kgdboc=", kgdboc_option_setup); - static void cleanup_kgdboc(void) { if (kgdb_unregister_nmi_console()) @@ -159,15 +141,13 @@ static int configure_kgdboc(void) { struct tty_driver *p; int tty_line = 0; - int err; + int err = -ENODEV; char *cptr = config; struct console *cons; - err = kgdboc_option_setup(config); - if (err || !strlen(config) || isspace(config[0])) + if (!strlen(config) || isspace(config[0])) goto noconfig; - err = -ENODEV; kgdboc_io_ops.is_console = 0; kgdb_tty_driver = NULL; @@ -316,6 +296,25 @@ static struct kgdb_io kgdboc_io_ops = { }; #ifdef CONFIG_KGDB_SERIAL_CONSOLE +static int kgdboc_option_setup(char *opt) +{ + if (!opt) { + pr_err("config string not provided\n"); + return -EINVAL; + } + + if (strlen(opt) >= MAX_CONFIG_LEN) { + pr_err("config string too long\n"); + return -ENOSPC; + } + strcpy(config, opt); + + return 0; +} + +__setup("kgdboc=", kgdboc_option_setup); + + /* This is only available if kgdboc is a built in for early debugging */ static int __init kgdboc_early_init(char *opt) { |