[PATCH v2 4/6] state: also append backend storage stridesize

Markus Pargmann mpa at pengutronix.de
Fri Jun 24 03:06:00 PDT 2016


From: Michael Grzeschik <m.grzeschik at pengutronix.de>

Signed-off-by: Michael Grzeschik <m.grzeschik at pengutronix.de>
Signed-off-by: Markus Pargmann <mpa at pengutronix.de>
---
 common/state/backend_storage.c | 1 +
 common/state/state.c           | 7 +++++++
 common/state/state.h           | 1 +
 3 files changed, 9 insertions(+)

diff --git a/common/state/backend_storage.c b/common/state/backend_storage.c
index 4620eda3eff6..0793afb43226 100644
--- a/common/state/backend_storage.c
+++ b/common/state/backend_storage.c
@@ -428,6 +428,7 @@ int state_storage_init(struct state_backend_storage *storage,
 	INIT_LIST_HEAD(&storage->buckets);
 	storage->dev = dev;
 	storage->name = storagetype;
+	storage->stridesize = stridesize;
 
 	ret = mtd_get_meminfo(path, &meminfo);
 	if (!ret && !(meminfo.flags & MTD_NO_ERASE)) {
diff --git a/common/state/state.c b/common/state/state.c
index 2a689596c79a..609a8288e6a2 100644
--- a/common/state/state.c
+++ b/common/state/state.c
@@ -374,6 +374,13 @@ static int of_state_fixup(struct device_node *root, void *ctx)
 		}
 	}
 
+	if (state->backend.storage.stridesize) {
+		ret = of_property_write_u32(new_node, "backend-stridesize",
+				state->backend.storage.stridesize);
+		if (ret)
+			goto out;
+	}
+
 	/* address-cells + size-cells */
 	ret = of_property_write_u32(new_node, "#address-cells", 1);
 	if (ret)
diff --git a/common/state/state.h b/common/state/state.h
index 329fac2b82b6..b957c68be79c 100644
--- a/common/state/state.h
+++ b/common/state/state.h
@@ -70,6 +70,7 @@ struct state_backend_storage {
 	struct device_d *dev;
 
 	const char *name;
+	uint32_t stridesize;
 };
 
 /**
-- 
2.8.1




More information about the barebox mailing list