aboutsummaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorMarcel Ziswiler <marcel@ziswiler.com>2019-05-20 02:44:57 +0200
committerTom Rini <trini@konsulko.com>2020-06-30 11:12:28 -0400
commit45224e8f26913bbd70960f316401134f3c366d78 (patch)
treec4cc7703dd9ef105d5a7b392c1beee11edea1460 /drivers
parentf992af81e9530918d58d5c7c09fabe93d03d0ac2 (diff)
downloadu-boot-45224e8f26913bbd70960f316401134f3c366d78.zip
u-boot-45224e8f26913bbd70960f316401134f3c366d78.tar.gz
u-boot-45224e8f26913bbd70960f316401134f3c366d78.tar.bz2
dm: core: gracefully handle alias seq without of
Gracefully handle alias seq in the platform data rather than OF case. Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/core/read.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/core/read.c b/drivers/core/read.c
index 047089c..85b3b7a 100644
--- a/drivers/core/read.c
+++ b/drivers/core/read.c
@@ -275,15 +275,17 @@ int dev_read_alias_seq(const struct udevice *dev, int *devnump)
{
ofnode node = dev_ofnode(dev);
const char *uc_name = dev->uclass->uc_drv->name;
- int ret;
+ int ret = -ENOTSUPP;
if (ofnode_is_np(node)) {
ret = of_alias_get_id(ofnode_to_np(node), uc_name);
if (ret >= 0)
*devnump = ret;
} else {
+#if CONFIG_IS_ENABLED(OF_CONTROL)
ret = fdtdec_get_alias_seq(gd->fdt_blob, uc_name,
ofnode_to_offset(node), devnump);
+#endif
}
return ret;