From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?q?=C3=81lvaro=20Fern=C3=A1ndez=20Rojas?= Date: Tue, 18 Apr 2017 22:38:35 +0200 Subject: [U-Boot] [PATCH v3 06/15] cmd: cpu: ensure udevice is probed before calling cpu ops In-Reply-To: <1492547924-32523-1-git-send-email-noltari@gmail.com> References: <1492293846-10640-1-git-send-email-noltari@gmail.com> <1492547924-32523-1-git-send-email-noltari@gmail.com> Message-ID: <1492547924-32523-7-git-send-email-noltari@gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de This causes exceptions for drivers that aren't probed when cpu ops are requested. Signed-off-by: Álvaro Fernández Rojas --- 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 #include #include +#include #include 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 ? "" : buf); -- 2.1.4