From 30b9f6f88e4e310a03458eecee5f594ebd218564 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Thu, 7 Mar 2019 23:57:21 -0800 Subject: [PATCH] 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 --- common/board_f.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/common/board_f.c b/common/board_f.c index 149a7229e8..a45fbf7f68 100644 --- a/common/board_f.c +++ b/common/board_f.c @@ -176,11 +176,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)); -- 2.17.1