summaryrefslogtreecommitdiffstats
path: root/common/state/state.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/state/state.c')
-rw-r--r--common/state/state.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/common/state/state.c b/common/state/state.c
index 476e3ee08e..1232ff3207 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -78,14 +78,14 @@ out:
* we read is checked for integrity by the formatter. After that we unpack the
* data into our state.
*/
-int state_load(struct state *state)
+static int state_do_load(struct state *state, enum state_flags flags)
{
void *buf;
ssize_t len;
int ret;
ret = state_storage_read(&state->storage, state->format,
- state->magic, &buf, &len);
+ state->magic, &buf, &len, flags);
if (ret) {
dev_err(&state->dev, "Failed to read state with format %s, %d\n",
state->format->name, ret);
@@ -106,6 +106,16 @@ out:
return ret;
}
+int state_load(struct state *state)
+{
+ return state_do_load(state, 0);
+}
+
+int state_load_no_auth(struct state *state)
+{
+ return state_do_load(state, STATE_FLAG_NO_AUTHENTIFICATION);
+}
+
static int state_format_init(struct state *state, const char *backend_format,
struct device_node *node, const char *state_name)
{