summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-22 12:28:57 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:44 +0200
commit86a5a1df39cf8dce9a685239f347284a3494aa06 (patch)
treee4c59bc1221d366567551d138831ab8a08360144
parent79df9aed28ee3bdfbd58bcfc164941bfca481cdb (diff)
downloaddt-utils-86a5a1df39cf8dce9a685239f347284a3494aa06.tar.gz
state: remove unnecessary argument from state_format_init
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@pengutronix.de>
-rw-r--r--src/barebox-state/state.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c
index 47cd218..4484837 100644
--- a/src/barebox-state/state.c
+++ b/src/barebox-state/state.c
@@ -105,25 +105,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;
@@ -602,7 +601,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;