summaryrefslogtreecommitdiffstats
path: root/drivers/misc
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-29 14:29:12 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 18:43:53 +0200
commitccb5b80125a0b95e8954260eddd7f40a61c8e65e (patch)
tree237a40f85a2da752c90c11b390d45a7b30843c35 /drivers/misc
parent13d85dfe2a47bed91724ce73f9929a09ff739090 (diff)
downloadbarebox-ccb5b80125a0b95e8954260eddd7f40a61c8e65e.tar.gz
barebox-ccb5b80125a0b95e8954260eddd7f40a61c8e65e.tar.xz
state: Do not load state during state_new_from_node
The caller of state_new_from_node() may have it's own ideas what to do when loading the state fails, so do not load it in the initialization function, but instead let the caller do it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'drivers/misc')
-rw-r--r--drivers/misc/state.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/misc/state.c b/drivers/misc/state.c
index b43aee60fe..98ed42e757 100644
--- a/drivers/misc/state.c
+++ b/drivers/misc/state.c
@@ -26,6 +26,7 @@ static int state_probe(struct device_d *dev)
struct device_node *np = dev->device_node;
struct state *state;
bool readonly = false;
+ int ret;
state = state_new_from_node(np, NULL, 0, 0, readonly);
if (IS_ERR(state)) {
@@ -35,6 +36,11 @@ static int state_probe(struct device_d *dev)
return ret;
}
+ ret = state_load(state);
+ if (ret)
+ dev_warn(dev, "Failed to load persistent state, continuing with defaults, %d\n",
+ ret);
+
return 0;
}