mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-25 06:00:43 +00:00
common/console.c: ensure GD_FLG_SILENT is set or cleared
When CONFIG_SILENT_CONSOLE is defined and the default environment has silent=1 it is not possible for a user to make the console un-silent if the environment is not available when console_init_f() is called (for example because the environment is in SPI). Add a new helper function console_update_silent() and call it from both console_init_f() and console_init_r(). Signed-off-by: Chris Packham <judge.packham@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
234600c1ca
commit
43e0a3dec0
1 changed files with 13 additions and 4 deletions
|
@ -687,15 +687,22 @@ int console_assign(int file, const char *devname)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static void console_update_silent(void)
|
||||
{
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (getenv("silent") != NULL)
|
||||
gd->flags |= GD_FLG_SILENT;
|
||||
else
|
||||
gd->flags &= ~GD_FLG_SILENT;
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Called before relocation - use serial functions */
|
||||
int console_init_f(void)
|
||||
{
|
||||
gd->have_console = 1;
|
||||
|
||||
#ifdef CONFIG_SILENT_CONSOLE
|
||||
if (getenv("silent") != NULL)
|
||||
gd->flags |= GD_FLG_SILENT;
|
||||
#endif
|
||||
console_update_silent();
|
||||
|
||||
print_pre_console_buffer(PRE_CONSOLE_FLUSHPOINT1_SERIAL);
|
||||
|
||||
|
@ -831,6 +838,8 @@ int console_init_r(void)
|
|||
struct list_head *pos;
|
||||
struct stdio_dev *dev;
|
||||
|
||||
console_update_silent();
|
||||
|
||||
#ifdef CONFIG_SPLASH_SCREEN
|
||||
/*
|
||||
* suppress all output if splash screen is enabled and we have
|
||||
|
|
Loading…
Reference in a new issue