mirror of
https://github.com/u-boot/u-boot.git
synced 2025-05-08 19:11:53 +00:00
console: unify printing current devices
Create stdio_print_current_devices() for this purpose Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
This commit is contained in:
parent
a694610d33
commit
7e3be7cf3b
2 changed files with 30 additions and 46 deletions
|
@ -532,6 +532,33 @@ int console_init_f(void)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void stdio_print_current_devices(void)
|
||||||
|
{
|
||||||
|
#ifdef CONFIG_SYS_CONSOLE_INFO_QUIET
|
||||||
|
/* Print information */
|
||||||
|
puts("In: ");
|
||||||
|
if (stdio_devices[stdin] == NULL) {
|
||||||
|
puts("No input devices available!\n");
|
||||||
|
} else {
|
||||||
|
printf ("%s\n", stdio_devices[stdin]->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
puts("Out: ");
|
||||||
|
if (stdio_devices[stdout] == NULL) {
|
||||||
|
puts("No output devices available!\n");
|
||||||
|
} else {
|
||||||
|
printf ("%s\n", stdio_devices[stdout]->name);
|
||||||
|
}
|
||||||
|
|
||||||
|
puts("Err: ");
|
||||||
|
if (stdio_devices[stderr] == NULL) {
|
||||||
|
puts("No error devices available!\n");
|
||||||
|
} else {
|
||||||
|
printf ("%s\n", stdio_devices[stderr]->name);
|
||||||
|
}
|
||||||
|
#endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV
|
#ifdef CONFIG_SYS_CONSOLE_IS_IN_ENV
|
||||||
/* Called after the relocation - use desired console functions */
|
/* Called after the relocation - use desired console functions */
|
||||||
int console_init_r(void)
|
int console_init_r(void)
|
||||||
|
@ -601,29 +628,7 @@ done:
|
||||||
|
|
||||||
gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
|
gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
|
||||||
|
|
||||||
#ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
|
stdio_print_current_devices();
|
||||||
/* Print information */
|
|
||||||
puts("In: ");
|
|
||||||
if (stdio_devices[stdin] == NULL) {
|
|
||||||
puts("No input devices available!\n");
|
|
||||||
} else {
|
|
||||||
console_printdevs(stdin);
|
|
||||||
}
|
|
||||||
|
|
||||||
puts("Out: ");
|
|
||||||
if (stdio_devices[stdout] == NULL) {
|
|
||||||
puts("No output devices available!\n");
|
|
||||||
} else {
|
|
||||||
console_printdevs(stdout);
|
|
||||||
}
|
|
||||||
|
|
||||||
puts("Err: ");
|
|
||||||
if (stdio_devices[stderr] == NULL) {
|
|
||||||
puts("No error devices available!\n");
|
|
||||||
} else {
|
|
||||||
console_printdevs(stderr);
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
|
|
||||||
|
|
||||||
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
|
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
|
||||||
/* set the environment variables (will overwrite previous env settings) */
|
/* set the environment variables (will overwrite previous env settings) */
|
||||||
|
@ -694,29 +699,7 @@ int console_init_r(void)
|
||||||
|
|
||||||
gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
|
gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
|
||||||
|
|
||||||
#ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
|
stdio_print_current_devices();
|
||||||
/* Print information */
|
|
||||||
puts("In: ");
|
|
||||||
if (stdio_devices[stdin] == NULL) {
|
|
||||||
puts("No input devices available!\n");
|
|
||||||
} else {
|
|
||||||
printf("%s\n", stdio_devices[stdin]->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
puts("Out: ");
|
|
||||||
if (stdio_devices[stdout] == NULL) {
|
|
||||||
puts("No output devices available!\n");
|
|
||||||
} else {
|
|
||||||
printf("%s\n", stdio_devices[stdout]->name);
|
|
||||||
}
|
|
||||||
|
|
||||||
puts("Err: ");
|
|
||||||
if (stdio_devices[stderr] == NULL) {
|
|
||||||
puts("No error devices available!\n");
|
|
||||||
} else {
|
|
||||||
printf("%s\n", stdio_devices[stderr]->name);
|
|
||||||
}
|
|
||||||
#endif /* CONFIG_SYS_CONSOLE_INFO_QUIET */
|
|
||||||
|
|
||||||
/* Setting environment variables */
|
/* Setting environment variables */
|
||||||
for (i = 0; i < 3; i++) {
|
for (i = 0; i < 3; i++) {
|
||||||
|
|
|
@ -91,6 +91,7 @@ extern char *stdio_names[MAX_FILES];
|
||||||
*/
|
*/
|
||||||
int stdio_register (struct stdio_dev * dev);
|
int stdio_register (struct stdio_dev * dev);
|
||||||
int stdio_init (void);
|
int stdio_init (void);
|
||||||
|
void stdio_print_current_devices(void);
|
||||||
#ifdef CONFIG_SYS_STDIO_DEREGISTER
|
#ifdef CONFIG_SYS_STDIO_DEREGISTER
|
||||||
int stdio_deregister(char *devname);
|
int stdio_deregister(char *devname);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue