summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2023-07-30 17:29:25 +0300
committerSimon Glass <sjg@chromium.org>2023-08-02 21:05:57 +0300
commitca9d9263e5214d450e2693b6de297fee74ee753e (patch)
treefa3021cd8481997f169968616c2fd1cb070ea793
parentd4d97661d255571118b6fdee0cf082a75f29af29 (diff)
downloadu-boot-ca9d9263e5214d450e2693b6de297fee74ee753e.tar.xz
boot: fix bootdev_list()
uclass_get_device_by_name() is meant to return 0 or a negative error code. simple_itoa() cannot handle negative numbers. This leads to output like: => bootdev list -p Seq Probed Status Uclass Name --- ------ ------ -------- ------------------ c [ ] 18446744073709551614 spi_flash spi.bin@0.bootdev Convert the status to a positive number. Now we get Seq Probed Status Uclass Name --- ------ ------ -------- ------------------ c [ ] 2 spi_flash spi.bin@0.bootdev Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
-rw-r--r--boot/bootdev-uclass.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c
index 9660ff7567..3f2c8d7153 100644
--- a/boot/bootdev-uclass.c
+++ b/boot/bootdev-uclass.c
@@ -216,7 +216,7 @@ void bootdev_list(bool probe)
for (i = 0; dev; i++) {
printf("%3x [ %c ] %6s %-9.9s %s\n", dev_seq(dev),
device_active(dev) ? '+' : ' ',
- ret ? simple_itoa(ret) : "OK",
+ ret ? simple_itoa(-ret) : "OK",
dev_get_uclass_name(dev_get_parent(dev)), dev->name);
if (probe)
ret = uclass_next_device_check(&dev);