projects
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
d9b0ac9
)
console: Switch to use stdio_file_to_flags()
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Thu, 11 Feb 2021 15:09:37 +0000
(17:09 +0200)
committer
Tom Rini
<trini@konsulko.com>
Tue, 16 Feb 2021 16:16:07 +0000
(11:16 -0500)
Deduplicate code by replacing with stdio_file_to_flags() helper.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
common/console.c
patch
|
blob
|
history
diff --git
a/common/console.c
b/common/console.c
index 567273a0ce8bf963fd471882320a84f0389c2207..b1afb650ed3947f0345eb02a358687270e5b9f8b 100644
(file)
--- a/
common/console.c
+++ b/
common/console.c
@@
-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 */