mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
[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>
This commit is contained in:
parent
e8f5bdb02c
commit
3c0547ba8b
1 changed files with 36 additions and 36 deletions
|
@ -160,42 +160,6 @@ static int __init console_setup(char *str)
|
||||||
|
|
||||||
__setup("console=", console_setup);
|
__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)
|
static int __init log_buf_len_setup(char *str)
|
||||||
{
|
{
|
||||||
unsigned long size = memparse(str, &str);
|
unsigned long size = memparse(str, &str);
|
||||||
|
@ -670,6 +634,42 @@ static void call_console_drivers(unsigned long start, unsigned long end) {}
|
||||||
|
|
||||||
#endif
|
#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.
|
* acquire_console_sem - lock the console system for exclusive use.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue