]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
cmd/bootdev: print readable status code
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>
Sun, 30 Jul 2023 14:52:30 +0000 (16:52 +0200)
committerSimon Glass <sjg@chromium.org>
Wed, 2 Aug 2023 18:05:57 +0000 (12:05 -0600)
device_probe() called by the 'bootdev info' command
returns 0 or a negative error code.

itoa() cannot print negative numbers.

Convert the error code to a positive number.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
cmd/bootdev.c

index 5b1efaaee876d2349b97e2a656676544a614bc62..a657de6bd0f6440cf30f1d36761a49ede9edfc6e 100644 (file)
@@ -99,7 +99,7 @@ static int do_bootdev_info(struct cmd_tbl *cmdtp, int flag, int argc,
 
        printf("Name:      %s\n", dev->name);
        printf("Sequence:  %d\n", dev_seq(dev));
-       printf("Status:    %s\n", ret ? simple_itoa(ret) : device_active(dev) ?
+       printf("Status:    %s\n", ret ? simple_itoa(-ret) : device_active(dev) ?
                "Probed" : "OK");
        printf("Uclass:    %s\n", dev_get_uclass_name(dev_get_parent(dev)));
        printf("Bootflows: %d (%d valid)\n", i, num_valid);