diff options
author | Marek Vasut <marek.vasut@gmail.com> | 2021-07-04 22:32:05 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2021-07-14 23:48:00 +0300 |
commit | 93e310c3a69984aa7e0435994da86c349d2d69d4 (patch) | |
tree | e5960ebfcca97bd5f3efb51d5e19423d7c3969cc /common/board_info.c | |
parent | 10f3e157e8f9d95860033fcaec2953f8cf11d2d6 (diff) | |
download | u-boot-93e310c3a69984aa7e0435994da86c349d2d69d4.tar.xz |
board-info: Call sysinfo_detect() before sysinfo_get_str()
The sysinfo_get_str() implementation checks whether the sysinfo was even
detected. In U-Boot proper, sysinfo_detect() is not called anywhere but
on one specific board. Call sysinfo_detect() before sysinfo_get_str() to
make sure the sysinfo is detected and sysinfo_get_str() returns valid
value instead of -EPERM.
Signed-off-by: Marek Vasut <marek.vasut+renesas@gmail.com>
Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Cc: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/board_info.c')
-rw-r--r-- | common/board_info.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/board_info.c b/common/board_info.c index 89a29c322c..e0f2d93922 100644 --- a/common/board_info.c +++ b/common/board_info.c @@ -32,10 +32,14 @@ int __weak show_board_info(void) if (IS_ENABLED(CONFIG_SYSINFO)) { /* This might provide more detail */ ret = sysinfo_get(&dev); - if (!ret) - ret = sysinfo_get_str(dev, + if (!ret) { + ret = sysinfo_detect(dev); + if (!ret) { + ret = sysinfo_get_str(dev, SYSINFO_ID_BOARD_MODEL, sizeof(str), str); + } + } } /* Fail back to the main 'model' if available */ |