Commit 326cf52c4c214c0c14da783914c51a0298543e26

Authored by Ye Li
1 parent d436521d7d

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)

Showing 1 changed file with 5 additions and 5 deletions Side-by-side Diff

... ... @@ -183,11 +183,11 @@
183 183 char desc[512];
184 184 int ret;
185 185  
186   - ret = uclass_first_device_err(UCLASS_CPU, &dev);
187   - if (ret) {
188   - debug("%s: Could not get CPU device (err = %d)\n",
189   - __func__, ret);
190   - return ret;
  186 + dev = cpu_get_current_dev();
  187 + if (!dev) {
  188 + debug("%s: Could not get CPU device\n",
  189 + __func__);
  190 + return -ENODEV;
191 191 }
192 192  
193 193 ret = cpu_get_desc(dev, desc, sizeof(desc));