mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 15:37:23 +00:00
common: board_f: Print information for all sysresets
Boards can have multiple sysresets, iterate all when printing sysreset
info.
Fixes: 23471aed5c
("board_f: Add reset status printing")
Signed-off-by: Michal Suchanek <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
5b2f49c033
commit
9259bd1735
1 changed files with 18 additions and 11 deletions
|
@ -146,20 +146,27 @@ static int print_resetinfo(void)
|
|||
{
|
||||
struct udevice *dev;
|
||||
char status[256];
|
||||
bool status_printed = false;
|
||||
int ret;
|
||||
|
||||
ret = uclass_first_device_err(UCLASS_SYSRESET, &dev);
|
||||
if (ret) {
|
||||
debug("%s: No sysreset device found (error: %d)\n",
|
||||
__func__, ret);
|
||||
/* Not all boards have sysreset drivers available during early
|
||||
* boot, so don't fail if one can't be found.
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
/* Not all boards have sysreset drivers available during early
|
||||
* boot, so don't fail if one can't be found.
|
||||
*/
|
||||
for (ret = uclass_first_device_check(UCLASS_SYSRESET, &dev); dev;
|
||||
ret = uclass_next_device_check(&dev)) {
|
||||
if (ret) {
|
||||
debug("%s: %s sysreset device (error: %d)\n",
|
||||
__func__, dev->name, ret);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!sysreset_get_status(dev, status, sizeof(status)))
|
||||
printf("%s", status);
|
||||
if (!sysreset_get_status(dev, status, sizeof(status))) {
|
||||
printf("%s%s", status_printed ? " " : "", status);
|
||||
status_printed = true;
|
||||
}
|
||||
}
|
||||
if (status_printed)
|
||||
printf("\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue