Commit 3c0547ba8b3bbd8b26ae35e33ac17ff51f67f78c

Authored by Matt Mackall
Committed by Linus Torvalds
1 parent e8f5bdb02c

[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 <mpm@selenic.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

Showing 1 changed file with 36 additions and 36 deletions Side-by-side Diff

... ... @@ -160,42 +160,6 @@
160 160  
161 161 __setup("console=", console_setup);
162 162  
163   -/**
164   - * add_preferred_console - add a device to the list of preferred consoles.
165   - *
166   - * The last preferred console added will be used for kernel messages
167   - * and stdin/out/err for init. Normally this is used by console_setup
168   - * above to handle user-supplied console arguments; however it can also
169   - * be used by arch-specific code either to override the user or more
170   - * commonly to provide a default console (ie from PROM variables) when
171   - * the user has not supplied one.
172   - */
173   -int __init add_preferred_console(char *name, int idx, char *options)
174   -{
175   - struct console_cmdline *c;
176   - int i;
177   -
178   - /*
179   - * See if this tty is not yet registered, and
180   - * if we have a slot free.
181   - */
182   - for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++)
183   - if (strcmp(console_cmdline[i].name, name) == 0 &&
184   - console_cmdline[i].index == idx) {
185   - selected_console = i;
186   - return 0;
187   - }
188   - if (i == MAX_CMDLINECONSOLES)
189   - return -E2BIG;
190   - selected_console = i;
191   - c = &console_cmdline[i];
192   - memcpy(c->name, name, sizeof(c->name));
193   - c->name[sizeof(c->name) - 1] = 0;
194   - c->options = options;
195   - c->index = idx;
196   - return 0;
197   -}
198   -
199 163 static int __init log_buf_len_setup(char *str)
200 164 {
201 165 unsigned long size = memparse(str, &str);
... ... @@ -669,6 +633,42 @@
669 633 static void call_console_drivers(unsigned long start, unsigned long end) {}
670 634  
671 635 #endif
  636 +
  637 +/**
  638 + * add_preferred_console - add a device to the list of preferred consoles.
  639 + *
  640 + * The last preferred console added will be used for kernel messages
  641 + * and stdin/out/err for init. Normally this is used by console_setup
  642 + * above to handle user-supplied console arguments; however it can also
  643 + * be used by arch-specific code either to override the user or more
  644 + * commonly to provide a default console (ie from PROM variables) when
  645 + * the user has not supplied one.
  646 + */
  647 +int __init add_preferred_console(char *name, int idx, char *options)
  648 +{
  649 + struct console_cmdline *c;
  650 + int i;
  651 +
  652 + /*
  653 + * See if this tty is not yet registered, and
  654 + * if we have a slot free.
  655 + */
  656 + for(i = 0; i < MAX_CMDLINECONSOLES && console_cmdline[i].name[0]; i++)
  657 + if (strcmp(console_cmdline[i].name, name) == 0 &&
  658 + console_cmdline[i].index == idx) {
  659 + selected_console = i;
  660 + return 0;
  661 + }
  662 + if (i == MAX_CMDLINECONSOLES)
  663 + return -E2BIG;
  664 + selected_console = i;
  665 + c = &console_cmdline[i];
  666 + memcpy(c->name, name, sizeof(c->name));
  667 + c->name[sizeof(c->name) - 1] = 0;
  668 + c->options = options;
  669 + c->index = idx;
  670 + return 0;
  671 +}
672 672  
673 673 /**
674 674 * acquire_console_sem - lock the console system for exclusive use.