Gracefully handle alias seq in the platform data rather than OF case.
Signed-off-by: Marcel Ziswiler <marcel@ziswiler.com>
{
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;
static inline int dev_read_alias_seq(const struct udevice *dev, int *devnump)
{
+#if CONFIG_IS_ENABLED(OF_CONTROL)
return fdtdec_get_alias_seq(gd->fdt_blob, dev->uclass->uc_drv->name,
dev_of_offset(dev), devnump);
+#else
+ return -ENOTSUPP;
+#endif
}
static inline int dev_read_u32_array(const struct udevice *dev,