summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2019-03-07 23:57:21 -0800
committerYe Li <ye.li@nxp.com>2020-04-23 02:03:53 -0700
commit11a3c82719422eaa7bd694f6a07cdce660b06a20 (patch)
treecae334e378c4953dec5ee6f026affe5041dea671 /common
parentc764f454ab411530be48f11ac6681107bcb60a8c (diff)
MLK-21828-2 common: board_f: Use cpu_get_current_dev in print_cpuinfo
Current print_cpuinfo gets the first udevice in CPU class to return the cpu info. This has problem if the boot CPU is not fixed. Change to use new API cpu_get_current_dev to resolve the issue. Signed-off-by: Ye Li <ye.li@nxp.com> (cherry picked from commit 30b9f6f88e4e310a03458eecee5f594ebd218564)
Diffstat (limited to 'common')
-rw-r--r--common/board_f.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/common/board_f.c b/common/board_f.c
index 82a164752a..babc2454bf 100644
--- a/common/board_f.c
+++ b/common/board_f.c
@@ -183,11 +183,11 @@ static int print_cpuinfo(void)
char desc[512];
int ret;
- ret = uclass_first_device_err(UCLASS_CPU, &dev);
- if (ret) {
- debug("%s: Could not get CPU device (err = %d)\n",
- __func__, ret);
- return ret;
+ dev = cpu_get_current_dev();
+ if (!dev) {
+ debug("%s: Could not get CPU device\n",
+ __func__);
+ return -ENODEV;
}
ret = cpu_get_desc(dev, desc, sizeof(desc));