diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-13 20:31:47 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2019-02-13 20:31:47 +0100 |
commit | 2a17e75a976d11c1712972d29813094b8020ac35 (patch) | |
tree | ea0e991c927752937803d72a5411f7159365aa83 /common/state/state.c | |
parent | a5f75fe8175aefec5b7cefaadc5359096c8eb22c (diff) | |
parent | 7185b353c96e1e831533eeaaada06ad9bebf84a2 (diff) | |
download | barebox-2a17e75a976d11c1712972d29813094b8020ac35.tar.gz barebox-2a17e75a976d11c1712972d29813094b8020ac35.tar.xz |
Merge branch 'for-next/misc'
Diffstat (limited to 'common/state/state.c')
-rw-r--r-- | common/state/state.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/common/state/state.c b/common/state/state.c index 54c57232e6..3f5d43ecbf 100644 --- a/common/state/state.c +++ b/common/state/state.c @@ -128,7 +128,7 @@ int state_load(struct state *state) int state_load_no_auth(struct state *state) { - return state_do_load(state, STATE_FLAG_NO_AUTHENTIFICATION); + return state_do_load(state, STATE_FLAG_NO_AUTHENTICATION); } static int state_format_init(struct state *state, const char *backend_format, @@ -596,6 +596,8 @@ struct state *state_new_from_node(struct device_node *node, bool readonly) const char *alias; uint32_t stridesize; struct device_node *partition_node; + off_t offset = 0; + size_t size = 0; alias = of_alias_get(node); if (!alias) { @@ -614,7 +616,11 @@ struct state *state_new_from_node(struct device_node *node, bool readonly) goto out_release_state; } +#ifdef __BAREBOX__ ret = of_find_path_by_node(partition_node, &state->backend_path, 0); +#else + ret = of_get_devicepath(partition_node, &state->backend_path, &offset, &size); +#endif if (ret) { if (ret != -EPROBE_DEFER) dev_err(&state->dev, "state failed to parse path to backend: %s\n", @@ -645,8 +651,8 @@ struct state *state_new_from_node(struct device_node *node, bool readonly) if (ret) goto out_release_state; - ret = state_storage_init(state, state->backend_path, 0, - 0, stridesize, storage_type); + ret = state_storage_init(state, state->backend_path, offset, + size, stridesize, storage_type); if (ret) goto out_release_state; |