From 3c0547ba8b3bbd8b26ae35e33ac17ff51f67f78c Mon Sep 17 00:00:00 2001 From: Matt Mackall Date: Mon, 16 May 2005 21:53:47 -0700 Subject: [PATCH] add_preferred_console() build fix Move add_preferred_console out of CONFIG_PRINTK so serial console does the right thing. Signed-off-by: Matt Mackall Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- kernel/printk.c | 72 ++++++++++++++++++++++++++++----------------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'kernel/printk.c') diff --git a/kernel/printk.c b/kernel/printk.c index 290a07ce2c8a..01b58d7d17ff 100644 --- a/kernel/printk.c +++ b/kernel/printk.c @@ -160,42 +160,6 @@ static int __init console_setup(char *str) __setup("console=", console_setup); -/** - * add_preferred_console - add a device to the list of preferred consoles. - * - * The last preferred console added will be used for kernel messages - * and stdin/out/err for init. Normally this is used by console_setup - * above to handle user-supplied console arguments; however it can also - * be used by arch-specific code either to override the user or more - * commonly to provide a default console (ie from PROM variables) when - * the user has not supplied one. - */ -int __init add_preferred_console(char *name, int idx, char *options) -{ - struct console_cmdline *c; - int i; - - /* - * See if this tty is not yet registered, and - * if we have a slot free. - */ - for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) - if (strcmp(console_cmdline[i].name, name) == 0 && - console_cmdline[i].index == idx) { - selected_console = i; - return 0; - } - if (i == MAX_CMDLINECONSOLES) - return -E2BIG; - selected_console = i; - c = &console_cmdline[i]; - memcpy(c->name, name, sizeof(c->name)); - c->name[sizeof(c->name) - 1] = 0; - c->options = options; - c->index = idx; - return 0; -} - static int __init log_buf_len_setup(char *str) { unsigned long size = memparse(str, &str); @@ -670,6 +634,42 @@ static void call_console_drivers(unsigned long start, unsigned long end) {} #endif +/** + * add_preferred_console - add a device to the list of preferred consoles. + * + * The last preferred console added will be used for kernel messages + * and stdin/out/err for init. Normally this is used by console_setup + * above to handle user-supplied console arguments; however it can also + * be used by arch-specific code either to override the user or more + * commonly to provide a default console (ie from PROM variables) when + * the user has not supplied one. + */ +int __init add_preferred_console(char *name, int idx, char *options) +{ + struct console_cmdline *c; + int i; + + /* + * See if this tty is not yet registered, and + * if we have a slot free. + */ + for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++) + if (strcmp(console_cmdline[i].name, name) == 0 && + console_cmdline[i].index == idx) { + selected_console = i; + return 0; + } + if (i == MAX_CMDLINECONSOLES) + return -E2BIG; + selected_console = i; + c = &console_cmdline[i]; + memcpy(c->name, name, sizeof(c->name)); + c->name[sizeof(c->name) - 1] = 0; + c->options = options; + c->index = idx; + return 0; +} + /** * acquire_console_sem - lock the console system for exclusive use. * -- cgit v1.2.3 9'>drm-next-5.9 Unnamed repository; edit this file 'description' to name the repository.agd5f
summaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2017-07-06scripts/spelling.txt: add a bunch more spelling mistakesColin Ian King1-0/+31
2017-05-08treewide: spelling: correct diffrent[iate] and banlance typosJoe Perches1-0/+3
2017-05-08scripts/spelling.txt: add "intialise(d)" pattern and fix typo instancesMasahiro Yamada1-0/+3
2017-05-08scripts/spelling.txt: add regsiter -> register spelling mistakeStephen Boyd1-0/+1
2017-05-08scripts/spelling.txt: add "memory" pattern and fix typosStephen Boyd1-0/+1
2017-05-03scripts/spelling.txt: add several more common spelling mistakesColin Ian King1-0/+25
2017-03-09scripts/spelling.txt: add "overide" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-03-09scripts/spelling.txt: add "disble(d)" pattern and fix typo instancesMasahiro Yamada1-0/+2
2017-02-27scripts/spelling.txt: add some typo-wordsJinbum Park1-0/+3
2017-02-27scripts/spelling.txt: add "followings" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "therfore" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "overwriten" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "overwritting" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "deintialize(d)" pattern and fix typo instancesMasahiro Yamada1-0/+3
2017-02-27scripts/spelling.txt: add "disassocation" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "omited" pattern and fix typo instancesMasahiro Yamada1-0/+2
2017-02-27scripts/spelling.txt: add "explictely" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "applys" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "configuartion" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "overrided" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "comsume(r)" pattern and fix typo instancesMasahiro Yamada1-0/+3
2017-02-27scripts/spelling.txt: add "initialiazation" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "intialization" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "unneded" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "neded" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "againt" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "embeded" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "varible" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "efective" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "algined" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "aligment" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "an one" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "an union" pattern and fix typo instancesMasahiro Yamada1-0/+1
2017-02-27scripts/spelling.txt: add "an user" pattern and fix typo instancesMasahiro Yamada1-0/+2
2017-02-27scripts/spelling.txt: add "swithc" pattern and fix typo instancesMasahiro Yamada1-0/+3
2017-02-27scripts/spelling.txt: add "swith" pattern and fix typo instancesMasahiro Yamada1-0/+4
2017-02-22scripts/spelling.txt: fix incorrect typo-wordsRoss Zwisler1-3/+3
2017-02-22scripts/spelling.txt: add several more common spelling mistakesColin Ian King1-0/+37
2016-10-07spelling.txt: "modeled" is spelt correctlyJoe Perches1-1/+0
2016-05-19scripts/spelling.txt: add "fimware" misspellingKees Cook1-0/+1
2015-09-04scripts/spelling.txt: add some typo-wordsZhao Lei1-0/+24
2015-09-04scripts/spelling.txt: spelling of uninitializedSudip Mukherjee1-0/+1
2015-09-04scripts/spelling.txt: add misspelled words for checkManinder Singh1-0/+4
2015-04-17checkpatch: spell check reudceJani Nikula1-0/+1
2014-10-14checkpatch: look for common misspellingsKees Cook1-0/+1042