summaryrefslogtreecommitdiffstats
path: root/common/state
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-06-23 12:43:14 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2017-06-23 12:43:43 +0200
commit119f92b27e131a0cb506fe8d8bffe8010fb14a3d (patch)
tree6cffc989f0dbb7ddeec6fae73e04430e4bbc4545 /common/state
parent285a05487a6bb9ef023163a62006524a17835e0a (diff)
downloadbarebox-119f92b27e131a0cb506fe8d8bffe8010fb14a3d.tar.gz
barebox-119f92b27e131a0cb506fe8d8bffe8010fb14a3d.tar.xz
state: backend: always pass backend type to Linux dtb
When the "backend-storage-type" property is unset in the barebox dtb then barebox will use the default. Instead of leaving the property unset in the Linux dtb, set it to the value we used as default. By making the default explicit to Linux we force Linux to the same backend type, even when the defaults may differ. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'common/state')
-rw-r--r--common/state/backend_storage.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 8d24f7053d..3249d0bca6 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -368,7 +368,6 @@ int state_storage_init(struct state *state, const char *path,
INIT_LIST_HEAD(&storage->buckets);
storage->dev = &state->dev;
- storage->name = storagetype;
storage->stridesize = stridesize;
storage->offset = offset;
storage->max_size = max_size;
@@ -380,8 +379,10 @@ int state_storage_init(struct state *state, const char *path,
if (!ret && !(meminfo.flags & MTD_NO_ERASE)) {
bool circular;
if (!storagetype || !strcmp(storagetype, "circular")) {
+ storage->name = "circular";
circular = true;
} else if (!strcmp(storagetype, "noncircular")) {
+ storage->name = "noncircular";
dev_warn(storage->dev, "using old format circular storage type.\n");
circular = false;
} else {