From: "Ulrich Ölmann" <[email protected]>
To: Pengutronix Public Open-Source-Development <[email protected]>
Cc: "Ulrich Ölmann" <[email protected]>
Subject: [OSS-Tools] [PATCH dt-utils 09/13] state: backend_storage: harmonize code with barebox
Date: Mon, 30 Sep 2019 09:26:09 +0200 [thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>
This ports the following barebox commit:
| commit f3895311ef49171b58b5ea1f06942408c8685a1e
| Author: Lucas Stach <[email protected]>
| Date: Fri Jul 22 15:00:19 2016 +0200
|
| state: only build circular backend if MTD is enabled
|
| The circular backend depends on MTD symbols and is only useful
| if MTD is present. Exclude it from the build if MTD is not enabled.
|
| Signed-off-by: Lucas Stach <[email protected]>
| Signed-off-by: Sascha Hauer <[email protected]>
Signed-off-by: Ulrich Ölmann <[email protected]>
---
configure.ac | 2 ++
src/barebox-state/backend_storage.c | 6 ++++--
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 04c2226625c1..30332620190d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -41,6 +41,8 @@ AS_IF([test "x${enable_state_backward_compatibility}" = "xyes"], [
AC_DEFINE(CONFIG_STATE_BACKWARD_COMPATIBLE, [0])
])
+AC_DEFINE(CONFIG_MTD, [1], [Statically define to be enabled to harmonize barebox' & dt-utils' code base.])
+
AC_CHECK_FUNCS([__secure_getenv secure_getenv])
my_CFLAGS="-Wall \
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index 3879a8d35666..509427f16f1d 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -369,7 +369,7 @@ int state_storage_init(struct state *state, const char *path,
const char *storagetype)
{
struct state_backend_storage *storage = &state->storage;
- int ret;
+ int ret = -ENODEV;
struct mtd_info_user meminfo;
INIT_LIST_HEAD(&storage->buckets);
@@ -380,7 +380,9 @@ int state_storage_init(struct state *state, const char *path,
storage->max_size = max_size;
storage->path = xstrdup(path);
- ret = mtd_get_meminfo(path, &meminfo);
+ if (IS_ENABLED(CONFIG_MTD))
+ ret = mtd_get_meminfo(path, &meminfo);
+
if (!ret && !(meminfo.flags & MTD_NO_ERASE)) {
bool circular;
if (!storagetype || !strcmp(storagetype, "circular")) {
--
2.23.0
_______________________________________________
OSS-Tools mailing list
[email protected]
next prev parent reply other threads:[~2019-09-30 7:26 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-30 7:26 [OSS-Tools] [PATCH dt-utils 00/13] Harmonize dt-utils' and barebox' shared code base Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 01/13] state: Fix lseek error check in state_backend_bucket_direct_read() Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 02/13] state: Fix lseek error check in state_backend_bucket_direct_write() Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 03/13] state: Fix lseek error check in state_mtd_peb_read() Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 04/13] state: Fix lseek error check in state_mtd_peb_write() Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 05/13] state: check length Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 06/13] state: backend_bucket_circular: mark block as bad if mtd_peb_torture() failed Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 07/13] state: drop unused code and declarations for non-existing functions Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 08/13] state: keep backward compatibility Ulrich Ölmann
2019-10-22 9:46 ` Roland Hieber
2019-09-30 7:26 ` Ulrich Ölmann [this message]
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 10/13] state: harmonize code with barebox Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 11/13] " Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 12/13] configure: remove build time option '--disable-logging' Ulrich Ölmann
2019-09-30 7:26 ` [OSS-Tools] [PATCH dt-utils 13/13] configure: remove build time option '--enable-debug' Ulrich Ölmann
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 \
[email protected] \
[email protected] \
[email protected] \
/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