emul: Add messages in emul_init_for_bus_from_list

Add a log message to indicate that a new emulator is attached. Also add
a message in the assert to make it clearer what has gone wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass 2020-09-25 15:50:39 -06:00 committed by Anas Nashif
parent a1d8e55cad
commit 4d77edd6ba

View file

@ -46,10 +46,12 @@ int emul_init_for_bus_from_list(const struct device *dev,
const struct emul_link_for_bus *const end =
cfg->children + cfg->num_children;
LOG_INF("Registering %d emulator(s) for %s", cfg->num_children,
dev->name);
for (elp = cfg->children; elp < end; elp++) {
const struct emul *emul = emul_find_by_link(elp);
__ASSERT_NO_MSG(emul);
__ASSERT(emul, "Cannot find emulator for '%s'", elp->label);
int rc = emul->init(emul, dev);