diff options
author | Ye Li <ye.li@nxp.com> | 2020-05-03 21:58:50 +0800 |
---|---|---|
committer | Stefano Babic <sbabic@denx.de> | 2020-05-03 15:45:49 +0200 |
commit | f5b66af2cb18b1577b2898413e98df7dcd9bc67f (patch) | |
tree | a8e7087d1385ee73c5acad975274017d6397070f /common | |
parent | 143f0eeddda915bfbd6c8024a667c37084d4bdc2 (diff) | |
download | u-boot-f5b66af2cb18b1577b2898413e98df7dcd9bc67f.tar.gz |
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.
Changing to use new API cpu_get_current_dev to fix the issue.
Reviewed-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'common')
-rw-r--r-- | common/board_f.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/common/board_f.c b/common/board_f.c index 5c650f046c..5223453511 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)); |