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>
This commit is contained in:
Andy Shevchenko 2021-02-11 17:09:40 +02:00 committed by Tom Rini
parent 09d8f07762
commit 658d6c5836

View File

@ -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);