Skip to content

Commit

Permalink
cmd/bootdev: print readable status code
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
xypron authored and sjg20 committed Aug 2, 2023
1 parent ca9d926 commit 0236642
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/bootdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 0236642

Please sign in to comment.