summaryrefslogtreecommitdiff
path: root/common/cmd_nvedit.c
diff options
context:
space:
mode:
authorMichael Brandt <Michael.Brandt@stericsson.com>2009-10-22 09:53:44 +0200
committerMichael Brandt <Michael.Brandt@stericsson.com>2009-10-22 09:53:44 +0200
commit8eae61fe5292db29b5bd61cadc1613851dea0765 (patch)
tree813a8bdb4a1a82025975d7a26496983e64d25daa /common/cmd_nvedit.c
parenteb3f0f68ba384f179bb57ad8d5b0cd095eb4d7a4 (diff)
parentf67066b6b0740b826ed862615c5ab022aaf4779a (diff)
Merge branch 'master' of http://git.denx.de/u-boot
Diffstat (limited to 'common/cmd_nvedit.c')
-rwxr-xr-xcommon/cmd_nvedit.c62
1 files changed, 31 insertions, 31 deletions
diff --git a/common/cmd_nvedit.c b/common/cmd_nvedit.c
index 3fe1fc239..91dec157e 100755
--- a/common/cmd_nvedit.c
+++ b/common/cmd_nvedit.c
@@ -203,6 +203,37 @@ int _do_setenv (int flag, int argc, char *argv[])
break;
}
+ /* Check for console redirection */
+ if (strcmp(name,"stdin") == 0) {
+ console = stdin;
+ } else if (strcmp(name,"stdout") == 0) {
+ console = stdout;
+ } else if (strcmp(name,"stderr") == 0) {
+ console = stderr;
+ }
+
+ if (console != -1) {
+ if (argc < 3) { /* Cannot delete it! */
+ printf("Can't delete \"%s\"\n", name);
+ return 1;
+ }
+
+#ifdef CONFIG_CONSOLE_MUX
+ i = iomux_doenv(console, argv[2]);
+ if (i)
+ return i;
+#else
+ /* Try assigning specified device */
+ if (console_assign (console, argv[2]) < 0)
+ return 1;
+
+#ifdef CONFIG_SERIAL_MULTI
+ if (serial_assign (argv[2]) < 0)
+ return 1;
+#endif
+#endif /* CONFIG_CONSOLE_MUX */
+ }
+
/*
* Delete any existing definition
*/
@@ -230,37 +261,6 @@ int _do_setenv (int flag, int argc, char *argv[])
}
#endif
- /* Check for console redirection */
- if (strcmp(name,"stdin") == 0) {
- console = stdin;
- } else if (strcmp(name,"stdout") == 0) {
- console = stdout;
- } else if (strcmp(name,"stderr") == 0) {
- console = stderr;
- }
-
- if (console != -1) {
- if (argc < 3) { /* Cannot delete it! */
- printf("Can't delete \"%s\"\n", name);
- return 1;
- }
-
-#ifdef CONFIG_CONSOLE_MUX
- i = iomux_doenv(console, argv[2]);
- if (i)
- return i;
-#else
- /* Try assigning specified device */
- if (console_assign (console, argv[2]) < 0)
- return 1;
-
-#ifdef CONFIG_SERIAL_MULTI
- if (serial_assign (argv[2]) < 0)
- return 1;
-#endif
-#endif /* CONFIG_CONSOLE_MUX */
- }
-
/*
* Switch to new baudrate if new baudrate is supported
*/