console: 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:37 +02:00 committed by Tom Rini
parent d9b0ac90ba
commit 7b9ca3f89c

View File

@ -855,17 +855,9 @@ int console_assign(int file, const char *devname)
struct stdio_dev *dev;
/* Check for valid file */
switch (file) {
case stdin:
flag = DEV_FLAGS_INPUT;
break;
case stdout:
case stderr:
flag = DEV_FLAGS_OUTPUT;
break;
default:
return -1;
}
flag = stdio_file_to_flags(file);
if (flag < 0)
return flag;
/* Check for valid device name */