mirror of
https://github.com/u-boot/u-boot.git
synced 2024-12-02 09:03:27 +08:00
console: Set file and devices at one go
Logical continuation of the change that brought console_devices_set() is to unify console_setfile() with it and replace in the callers. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
This commit is contained in:
parent
20a7d35148
commit
09d8f07762
@ -233,7 +233,7 @@ static struct stdio_dev *tstcdev;
|
|||||||
struct stdio_dev **console_devices[MAX_FILES];
|
struct stdio_dev **console_devices[MAX_FILES];
|
||||||
int cd_count[MAX_FILES];
|
int cd_count[MAX_FILES];
|
||||||
|
|
||||||
static void __maybe_unused console_devices_set(int file, struct stdio_dev *dev)
|
static void console_devices_set(int file, struct stdio_dev *dev)
|
||||||
{
|
{
|
||||||
console_devices[file][0] = dev;
|
console_devices[file][0] = dev;
|
||||||
cd_count[file] = 1;
|
cd_count[file] = 1;
|
||||||
@ -370,7 +370,7 @@ static inline void console_doenv(int file, struct stdio_dev *dev)
|
|||||||
#endif
|
#endif
|
||||||
#else
|
#else
|
||||||
|
|
||||||
static void __maybe_unused console_devices_set(int file, struct stdio_dev *dev)
|
static void console_devices_set(int file, struct stdio_dev *dev)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -418,6 +418,12 @@ static inline void console_doenv(int file, struct stdio_dev *dev)
|
|||||||
#endif
|
#endif
|
||||||
#endif /* CONIFIG_IS_ENABLED(CONSOLE_MUX) */
|
#endif /* CONIFIG_IS_ENABLED(CONSOLE_MUX) */
|
||||||
|
|
||||||
|
static void __maybe_unused console_setfile_and_devices(int file, struct stdio_dev *dev)
|
||||||
|
{
|
||||||
|
console_setfile(file, dev);
|
||||||
|
console_devices_set(file, dev);
|
||||||
|
}
|
||||||
|
|
||||||
int console_start(int file, struct stdio_dev *sdev)
|
int console_start(int file, struct stdio_dev *sdev)
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
@ -1072,17 +1078,13 @@ int console_init_r(void)
|
|||||||
|
|
||||||
/* Initializes output console first */
|
/* Initializes output console first */
|
||||||
if (outputdev != NULL) {
|
if (outputdev != NULL) {
|
||||||
console_setfile(stdout, outputdev);
|
console_setfile_and_devices(stdout, outputdev);
|
||||||
console_setfile(stderr, outputdev);
|
console_setfile_and_devices(stderr, outputdev);
|
||||||
console_devices_set(stdout, outputdev);
|
|
||||||
console_devices_set(stderr, outputdev);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Initializes input console */
|
/* Initializes input console */
|
||||||
if (inputdev != NULL) {
|
if (inputdev != NULL)
|
||||||
console_setfile(stdin, inputdev);
|
console_setfile_and_devices(stdin, inputdev);
|
||||||
console_devices_set(stdin, inputdev);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!IS_ENABLED(CONFIG_SYS_CONSOLE_INFO_QUIET))
|
if (!IS_ENABLED(CONFIG_SYS_CONSOLE_INFO_QUIET))
|
||||||
stdio_print_current_devices();
|
stdio_print_current_devices();
|
||||||
|
Loading…
Reference in New Issue
Block a user