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 <msuchanek@suse.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Michal Suchanek
2022-10-12 21:57:51 +02:00
committed by Simon Glass
parent dfecd63192
commit c0648b7b9d
4 changed files with 9 additions and 54 deletions

View File

@@ -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;
debug("%s: Error while probing CPUs (err = %d %s)\n",
__func__, ret, errno_str(ret));
}
while (cpu) {
ret = uclass_next_device(&cpu);
if (ret) {
debug("%s: Error while probing CPU (err = %d)\n",
__func__, ret);
return ret;
}
}
return 0;
return ret;
}
int cpu_is_current(struct udevice *cpu)