aboutsummaryrefslogtreecommitdiff
path: root/common/iomux.c
diff options
context:
space:
mode:
authorAndy Shevchenko2021-02-11 17:09:40 +0200
committerTom Rini2021-02-16 11:16:08 -0500
commit658d6c583663ae4f37cb6a5e104b2bf864fbc497 (patch)
treeea96e65c37bf657c625b0bdbc694edcbdb8d6fad /common/iomux.c
parent09d8f07762747ca6cd530289ecdda21b1c92226b (diff)
IOMUX: Switch to use stdio_file_to_flags()
Deduplicate code by replacing with stdio_file_to_flags() helper. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Diffstat (limited to 'common/iomux.c')
-rw-r--r--common/iomux.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/common/iomux.c b/common/iomux.c
index 15bf5338855..5d027561bb6 100644
--- a/common/iomux.c
+++ b/common/iomux.c
@@ -75,15 +75,8 @@ int iomux_doenv(const int console, const char *arg)
return 1;
}
- switch (console) {
- case stdin:
- io_flag = DEV_FLAGS_INPUT;
- break;
- case stdout:
- case stderr:
- io_flag = DEV_FLAGS_OUTPUT;
- break;
- default:
+ io_flag = stdio_file_to_flags(console);
+ if (io_flag < 0) {
free(start);
free(console_args);
free(cons_set);