diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c index 4adc065..bfd7c56 100644 --- a/src/barebox-state/state.c +++ b/src/barebox-state/state.c @@ -572,19 +572,16 @@ } if (!path) { - /* guess if of_path is a path, not a phandle */ - if (of_path[0] == '/' && len > 1) { - ret = of_find_path(node, "backend", &path, 0); - } else { - struct device_node *partition_node; + struct device_node *partition_node; - partition_node = of_parse_phandle(node, "backend", 0); - if (!partition_node) - goto out_release_state; - - of_path = partition_node->full_name; - ret = of_find_path_by_node(partition_node, &path, 0); + partition_node = of_parse_phandle(node, "backend", 0); + if (!partition_node) { + dev_err(&state->dev, "Cannot resolve \"backend\" phandle\n"); + goto out_release_state; } + + of_path = partition_node->full_name; + ret = of_find_path_by_node(partition_node, &path, 0); if (ret) { if (ret != -EPROBE_DEFER) dev_err(&state->dev, "state failed to parse path to backend: %s\n", diff --git a/src/dt/dt.h b/src/dt/dt.h index 67f5fb7..8014cd3 100644 --- a/src/dt/dt.h +++ b/src/dt/dt.h @@ -370,12 +370,6 @@ struct device_node *of_read_proc_devicetree(void); -static inline int of_find_path(struct device_node *node, const char *propname, - char **outpath, unsigned flags) -{ - return -ENOSYS; -} - static inline int of_find_path_by_node(struct device_node *node, char **outpath, unsigned flags) {