mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Markus Pargmann <mpa@pengutronix.de>
To: barebox@lists.infradead.org
Cc: mgr@pengutronix.de
Subject: [PATCH v2 4/6] state: also append backend storage stridesize
Date: Fri, 24 Jun 2016 12:06:00 +0200	[thread overview]
Message-ID: <1466762762-15212-5-git-send-email-mpa@pengutronix.de> (raw)
In-Reply-To: <1466762762-15212-1-git-send-email-mpa@pengutronix.de>

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

Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
Signed-off-by: Markus Pargmann <mpa@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


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2016-06-24 10:07 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-24 10:05 [PATCH v2 0/6] state: Refactor backend Markus Pargmann
2016-06-24 10:05 ` [PATCH v2 1/6] libfile: Change write_full to be have const buf Markus Pargmann
2016-06-24 10:05 ` [PATCH v2 2/6] state: Refactor state framework Markus Pargmann
2016-06-24 10:05 ` [PATCH v2 3/6] docs: Add/Update state documentation Markus Pargmann
2016-06-24 10:06 ` Markus Pargmann [this message]
2016-06-24 10:06 ` [PATCH v2 5/6] state: backend_storage_direct: also use cached data on write Markus Pargmann
2016-06-28  6:18   ` Sascha Hauer
2016-06-28  6:55     ` Michael Grzeschik
2016-06-29  5:56       ` Markus Pargmann
2016-06-24 10:06 ` [PATCH v2 6/6] barebox-state: handle flush errno correctly Markus Pargmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1466762762-15212-5-git-send-email-mpa@pengutronix.de \
    --to=mpa@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=mgr@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox