summaryrefslogtreecommitdiff
path: root/drivers/cpu/cpu-uclass.c
diff options
context:
space:
mode:
authorMichal Suchanek <[email protected]>2022-10-12 21:57:51 +0200
committerSimon Glass <[email protected]>2022-10-17 21:17:12 -0600
commitc0648b7b9dc10ed49e2d4b1bedaa5ccd17e23fb3 (patch)
tree8cb4406afa764a4ba95f70127282ea28b6658002 /drivers/cpu/cpu-uclass.c
parentdfecd631922b61a062da3d1fa6a72f9fb93c0952 (diff)
dm: treewide: Do not opencode uclass_probe_all()
We already have a function for probing all devices of a specific class, use it. Signed-off-by: Michal Suchanek <[email protected]> Reviewed-by: Simon Glass <[email protected]>
Diffstat (limited to 'drivers/cpu/cpu-uclass.c')
-rw-r--r--drivers/cpu/cpu-uclass.c20
1 files changed, 4 insertions, 16 deletions
diff --git a/drivers/cpu/cpu-uclass.c b/drivers/cpu/cpu-uclass.c
index 71e5900d70e..a7548325265 100644
--- a/drivers/cpu/cpu-uclass.c
+++ b/drivers/cpu/cpu-uclass.c
@@ -20,25 +20,13 @@ DECLARE_GLOBAL_DATA_PTR;
int cpu_probe_all(void)
{
- struct udevice *cpu;
- int ret;
+ int ret = uclass_probe_all(UCLASS_CPU);
- ret = uclass_first_device(UCLASS_CPU, &cpu);
if (ret) {
- debug("%s: No CPU found (err = %d)\n", __func__, ret);
- return ret;
- }
-
- while (cpu) {
- ret = uclass_next_device(&cpu);
- if (ret) {
- debug("%s: Error while probing CPU (err = %d)\n",
- __func__, ret);
- return ret;
- }
+ debug("%s: Error while probing CPUs (err = %d %s)\n",
+ __func__, ret, errno_str(ret));
}
-
- return 0;
+ return ret;
}
int cpu_is_current(struct udevice *cpu)