summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-27 11:53:01 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:15 +0200
commitfd67d47d265b8e4aaae726caf5a5bb99f62b2215 (patch)
treeadf080a298b76f9249b8b36cef5dd885f0d49e74
parent50fb411a20980847abeb84acc7afa10e7d44f097 (diff)
downloaddt-utils-fd67d47d265b8e4aaae726caf5a5bb99f62b2215.tar.gz
barebox-state: Sync pieces with barebox
dev_add_param_bool are no-ops, save_on_shutdown is irrelevant for the userspace part. Sync with barebox as of v2017.03.0 Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--src/barebox-state/state.c13
-rw-r--r--src/barebox-state/state.h5
-rw-r--r--src/barebox-state/state_variables.c1
3 files changed, 7 insertions, 12 deletions
diff --git a/src/barebox-state/state.c b/src/barebox-state/state.c
index 37577a4..d07f522 100644
--- a/src/barebox-state/state.c
+++ b/src/barebox-state/state.c
@@ -33,11 +33,6 @@
/* list of all registered state instances */
static LIST_HEAD(state_list);
-static int state_set_deny(struct param_d *p, void *priv)
-{
- return -EROFS;
-}
-
static struct state *state_new(const char *name)
{
struct state *state;
@@ -57,10 +52,11 @@ static struct state *state_new(const char *name)
}
state->dirty = 1;
- dev_add_param_bool(&state->dev, "dirty", state_set_deny, NULL, &state->dirty,
- NULL);
- dev_add_param_bool(&state->dev, "default", state_set_deny, NULL, &state->state_default,
+ dev_add_param_bool(&state->dev, "dirty", NULL, NULL, &state->dirty,
NULL);
+ state->save_on_shutdown = 1;
+ dev_add_param_bool(&state->dev, "save_on_shutdown", NULL, NULL,
+ &state->save_on_shutdown, NULL);
list_add_tail(&state->list, &state_list);
@@ -515,7 +511,6 @@ struct state *state_new_from_node(struct device_node *node, char *path,
ret = state_load(state);
if (ret) {
dev_warn(&state->dev, "Failed to load persistent state, continuing with defaults, %d\n", ret);
- state->state_default = 1;
}
dev_info(&state->dev, "New state registered '%s'\n", alias);
diff --git a/src/barebox-state/state.h b/src/barebox-state/state.h
index 58de643..bc6917d 100644
--- a/src/barebox-state/state.h
+++ b/src/barebox-state/state.h
@@ -71,6 +71,7 @@ struct state_backend_storage {
struct device_d *dev;
const char *name;
+
uint32_t stridesize;
bool readonly;
@@ -98,8 +99,8 @@ struct state {
uint32_t magic;
struct list_head variables; /* Sorted list of variables */
- unsigned int dirty; /* State is different from stored state */
- unsigned int state_default; /* State has default values */
+ unsigned int dirty;
+ unsigned int save_on_shutdown;
struct state_backend backend;
};
diff --git a/src/barebox-state/state_variables.c b/src/barebox-state/state_variables.c
index 2e4a98c..fd072a0 100644
--- a/src/barebox-state/state_variables.c
+++ b/src/barebox-state/state_variables.c
@@ -39,7 +39,6 @@ static int state_set_dirty(struct param_d *p, void *priv)
struct state_variable *sv = priv;
sv->state->dirty = 1;
- sv->state->state_default = 0;
return 0;
}