mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-11 07:34:31 +00:00
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 <kever.yang@rock-chips.com> Reviewed-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
parent
8a681f4c5a
commit
8f0a70e816
1 changed files with 5 additions and 1 deletions
|
@ -212,7 +212,11 @@ ofnode ofnode_get_parent(ofnode node)
|
|||
|
||||
const char *ofnode_get_name(ofnode node)
|
||||
{
|
||||
assert(ofnode_valid(node));
|
||||
if (!ofnode_valid(node)) {
|
||||
debug("%s node not valid\n", __func__);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (ofnode_is_np(node))
|
||||
return strrchr(node.np->full_name, '/') + 1;
|
||||
|
||||
|
|
Loading…
Reference in a new issue