summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorJean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>2009-05-16 12:14:55 +0200
committerWolfgang Denk <wd@denx.de>2009-07-19 01:02:46 +0200
commit7e3be7cf3bb344f717b6ec3d47a081269ea67ead (patch)
tree15a53811bc8b871f6d82eec377822ead907112f8 /common
parenta694610d3361465d4c8d27dde72ab8b63d31115e (diff)
downloadu-boot-7e3be7cf3bb344f717b6ec3d47a081269ea67ead.tar.gz
u-boot-7e3be7cf3bb344f717b6ec3d47a081269ea67ead.tar.bz2
u-boot-7e3be7cf3bb344f717b6ec3d47a081269ea67ead.zip
console: unify printing current devices
Create stdio_print_current_devices() for this purpose Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Diffstat (limited to 'common')
-rw-r--r--common/console.c75
1 files changed, 29 insertions, 46 deletions
diff --git a/common/console.c b/common/console.c
index 0a36d2fedf..867c12c102 100644
--- a/common/console.c
+++ b/common/console.c
@@ -532,6 +532,33 @@ int console_init_f(void)
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
/* Called after the relocation - use desired console functions */
int console_init_r(void)
@@ -601,29 +628,7 @@ done:
gd->flags |= GD_FLG_DEVINIT; /* device initialization completed */
-#ifndef CONFIG_SYS_CONSOLE_INFO_QUIET
- /* 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 */
+ stdio_print_current_devices();
#ifdef CONFIG_SYS_CONSOLE_ENV_OVERWRITE
/* 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 */
-#ifndef 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 */
+ stdio_print_current_devices();
/* Setting environment variables */
for (i = 0; i < 3; i++) {