summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/barebox-state/backend_storage.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index acc2623..b7b6882 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -375,13 +375,15 @@ int state_storage_init(struct state *state, const char *path,
ret = mtd_get_meminfo(path, &meminfo);
if (!ret && !(meminfo.flags & MTD_NO_ERASE)) {
- bool circular = true;
- if (!storagetype) {
- circular = false;
- } else if (strcmp(storagetype, "circular")) {
- dev_warn(storage->dev, "Unknown storagetype '%s', falling back to old format circular storage type.\n",
- storagetype);
+ bool circular;
+ if (!storagetype || !strcmp(storagetype, "circular")) {
+ circular = true;
+ } else if (!strcmp(storagetype, "noncircular")) {
+ dev_warn(storage->dev, "using old format circular storage type.\n");
circular = false;
+ } else {
+ dev_warn(storage->dev, "unknown storage type '%s'\n", storagetype);
+ return -EINVAL;
}
return state_storage_mtd_buckets_init(storage, &meminfo, circular);
} else {