The device pointer is already in struct state, no need to pass it around when a struct state * is already passed. Signed-off-by: Sascha Hauer <s.hauer@xxxxxxxxxxxxxx> --- common/state/state.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/common/state/state.c b/common/state/state.c index fce8fcc943..87b704feba 100644 --- a/common/state/state.c +++ b/common/state/state.c @@ -106,25 +106,24 @@ out: return ret; } -static int state_format_init(struct state *state, - struct device_d *dev, const char *backend_format, +static int state_format_init(struct state *state, const char *backend_format, struct device_node *node, const char *state_name) { int ret; if (!backend_format || !strcmp(backend_format, "raw")) { ret = backend_format_raw_create(&state->format, node, - state_name, dev); + state_name, &state->dev); } else if (!strcmp(backend_format, "dtb")) { - ret = backend_format_dtb_create(&state->format, dev); + ret = backend_format_dtb_create(&state->format, &state->dev); } else { - dev_err(dev, "Invalid backend format %s\n", + dev_err(&state->dev, "Invalid backend format %s\n", backend_format); return -EINVAL; } if (ret && ret != -EPROBE_DEFER) - dev_err(dev, "Failed to initialize format %s, %d\n", + dev_err(&state->dev, "Failed to initialize format %s, %d\n", backend_format, ret); return ret; @@ -599,7 +598,7 @@ struct state *state_new_from_node(struct device_node *node, char *path, dev_info(&state->dev, "No backend-storage-type found, using default.\n"); } - ret = state_format_init(state, &state->dev, backend_type, node, alias); + ret = state_format_init(state, backend_type, node, alias); if (ret) goto out_release_state; -- 2.11.0 _______________________________________________ barebox mailing list barebox@xxxxxxxxxxxxxxxxxxx http://lists.infradead.org/mailman/listinfo/barebox