Dear U-boot Developers

 

Hello, my name is Luke Kim from Korea. Ive been looking at the u-boot code for debugging, and I think I found something in function console_init_r function in file common/console.c.

/***********************line 505****************************/

/* Scan devices looking for input and output devices */

    for (i = 1;

         (i <= items) && ((inputdev == NULL) || (outputdev == NULL));

         i++

        ) {

        device_t *dev = ListGetPtrToItem (devlist, i);

 

        if ((dev->flags & DEV_FLAGS_INPUT) && (inputdev == NULL)) {

            inputdev = dev;

        }

        if ((dev->flags & DEV_FLAGS_OUTPUT) && (outputdev == NULL)) {

            outputdev = dev;

        }

    }

 

    /* Initializes output console first */

    if (outputdev != NULL) {

        console_setfile (stdout, outputdev);

        console_setfile (stderr, outputdev);

    }

 

    /* Initializes input console */

    if (inputdev != NULL) {

        console_setfile (stdin, inputdev);

    }

 

    gd->flags |= GD_FLG_DEVINIT;    /* device initialization completed */

At the last line, it sets the GD_FLG_DEVINIT flag. But doesnt it have to check inputdev and outputdev first to check if its NULL? I think functions such as fputc will malfunction if the GD_FLG_DEVINIT flag is set when stdio_devices are NULL.

 

Best Regards

Luke