sandbox: show error if the device-tree cannot be loaded
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Mon, 4 Apr 2022 20:45:04 +0000 (22:45 +0200)
committerSimon Glass <sjg@chromium.org>
Tue, 28 Jun 2022 02:09:51 +0000 (03:09 +0100)
U-Boot's printf() used before setting up U-Boot's serial driver does not
create any output. Use os_printf() for error messages related to loading
the device-tree.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
arch/sandbox/cpu/cpu.c

index 7a82798..d077948 100644 (file)
@@ -331,27 +331,27 @@ void *board_fdt_blob_setup(int *ret)
                err = setup_auto_tree(blob);
                if (!err)
                        goto done;
-               printf("Unable to create empty FDT: %s\n", fdt_strerror(err));
+               os_printf("Unable to create empty FDT: %s\n", fdt_strerror(err));
                *ret = -EINVAL;
                goto fail;
        }
 
        err = os_get_filesize(fname, &size);
        if (err < 0) {
-               printf("Failed to find FDT file '%s'\n", fname);
+               os_printf("Failed to find FDT file '%s'\n", fname);
                *ret = err;
                goto fail;
        }
        fd = os_open(fname, OS_O_RDONLY);
        if (fd < 0) {
-               printf("Failed to open FDT file '%s'\n", fname);
+               os_printf("Failed to open FDT file '%s'\n", fname);
                *ret = -EACCES;
                goto fail;
        }
 
        if (os_read(fd, blob, size) != size) {
                os_close(fd);
-               printf("Failed to read FDT file '%s'\n", fname);
+               os_printf("Failed to read FDT file '%s'\n", fname);
                *ret =  -EIO;
                goto fail;
        }