diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c index bfd7c56..a0a3901 100644 --- a/src/barebox-state/state.c +++ b/src/barebox-state/state.c @@ -460,7 +460,7 @@ } /* backend phandle */ - backend_node = of_find_node_by_path_from(root, state->of_backend_path); + backend_node = of_find_node_by_devpath(root, state->backend_path); if (!backend_node) { ret = -ENODEV; goto out; @@ -528,7 +528,7 @@ unregister_device(&state->dev); state_storage_free(&state->storage); state_format_free(state->format); - free(state->of_backend_path); + free(state->backend_path); free(state->of_path); free(state); } @@ -590,6 +590,8 @@ } } + state->backend_path = xstrdup(path); + ret = of_property_read_string(node, "backend-type", &backend_type); if (ret) { goto out_release_state; @@ -616,8 +618,6 @@ if (ret) goto out_release_state; - state->of_backend_path = xstrdup(of_path); - if (readonly) state_backend_set_readonly(state); @@ -692,7 +692,7 @@ if (state->format) printf("(backend: %s, path: %s)\n", state->format->name, - state->of_backend_path); + state->backend_path); else printf("(no backend)\n"); } diff --git a/src/barebox-state/state.h b/src/barebox-state/state.h index 5e240c4..ead8cc8 100644 --- a/src/barebox-state/state.h +++ b/src/barebox-state/state.h @@ -104,7 +104,7 @@ struct state_backend_format *format; struct state_backend_storage storage; - char *of_backend_path; + char *backend_path; }; enum state_convert { diff --git a/src/dt/dt.h b/src/dt/dt.h index 8014cd3..6d71a71 100644 --- a/src/dt/dt.h +++ b/src/dt/dt.h @@ -376,4 +376,10 @@ return -ENOSYS; } +static inline struct device_node *of_find_node_by_devpath(struct device_node *root, + const char *path) +{ + return NULL; +} + #endif /* __DT_DT_H */