Commit 8f0a70e8 authored by Kever Yang's avatar Kever Yang

core: ofnode: do not assert if node not valid in ofnode_get_name()

In some case with LIVE DT, some node always not valid, or not have
a valid name, eg. blk driver add by mmc.
Return fail instead of Assert for this kind of ofnode, and this
help with assert happen from time to time when of_live is enabled
and DEBUG is enabled.
Signed-off-by: Kever Yang's avatarKever Yang <>
Reviewed-by: Simon Glass's avatarSimon Glass <>
parent 8a681f4c
......@@ -212,7 +212,11 @@ ofnode ofnode_get_parent(ofnode node)
const char *ofnode_get_name(ofnode node)
if (!ofnode_valid(node)) {
debug("%s node not valid\n", __func__);
return NULL;
if (ofnode_is_np(node))
return strrchr(>full_name, '/') + 1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment