[U-Boot] [PATCH v3 06/15] cmd: cpu: ensure udevice is probed before calling cpu ops

Álvaro Fernández Rojas noltari at gmail.com
Tue Apr 18 20:38:35 UTC 2017


This causes exceptions for drivers that aren't probed when cpu ops are
requested.

Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com>
---
 v3: add new patch to ensure that device is probed.

 cmd/cpu.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/cmd/cpu.c b/cmd/cpu.c
index adfd54a..91f60c2 100644
--- a/cmd/cpu.c
+++ b/cmd/cpu.c
@@ -9,6 +9,7 @@
 #include <command.h>
 #include <cpu.h>
 #include <dm.h>
+#include <dm/device-internal.h>
 #include <errno.h>
 
 static const char *cpu_feature_name[CPU_FEAT_COUNT] = {
@@ -36,6 +37,9 @@ static int print_cpu_list(bool detail)
 		bool first;
 		int i;
 
+		if (!device_active(dev) && device_probe(dev))
+			continue;
+
 		ret = cpu_get_desc(dev, buf, sizeof(buf));
 		printf("%3d: %-10s %s\n", dev->seq, dev->name,
 		       ret ? "<no description>" : buf);
-- 
2.1.4



More information about the U-Boot mailing list