mirror of
https://github.com/brain-hackers/u-boot-brain
synced 2024-06-09 23:36:03 +09:00
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:
parent
d9b0ac90ba
commit
7b9ca3f89c
|
@ -855,17 +855,9 @@ int console_assign(int file, const char *devname)
|
||||||
struct stdio_dev *dev;
|
struct stdio_dev *dev;
|
||||||
|
|
||||||
/* Check for valid file */
|
/* Check for valid file */
|
||||||
switch (file) {
|
flag = stdio_file_to_flags(file);
|
||||||
case stdin:
|
if (flag < 0)
|
||||||
flag = DEV_FLAGS_INPUT;
|
return flag;
|
||||||
break;
|
|
||||||
case stdout:
|
|
||||||
case stderr:
|
|
||||||
flag = DEV_FLAGS_OUTPUT;
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Check for valid device name */
|
/* Check for valid device name */
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user