From: Andy Shevchenko Date: Thu, 11 Feb 2021 15:09:40 +0000 (+0200) Subject: IOMUX: Switch to use stdio_file_to_flags() X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-logo.png?a=commitdiff_plain;h=658d6c583663ae4f37cb6a5e104b2bf864fbc497;p=u-boot.git IOMUX: Switch to use stdio_file_to_flags() Deduplicate code by replacing with stdio_file_to_flags() helper. Signed-off-by: Andy Shevchenko --- diff --git a/common/iomux.c b/common/iomux.c index 15bf533885..5d027561bb 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);