diff mbox series

[v2,2/2] core: blacklisting should depend on CONFIG_UBIATTACH

Message ID 20180822164756.20650-2-arnout@mind.be
State Accepted
Headers show
Series [v2,1/2] mtd-interface: add UBIATTACH config option | expand

Commit Message

Arnout Vandecappelle Aug. 22, 2018, 4:47 p.m. UTC
The blacklisting options should depend on CONFIG_UBIATTACH instead of
CONFIG_MTD. Indeed, blacklisting is only relevant for attaching a UBI
device. Thus, convert the CONFIG_MTD ifdefs into CONFIG_UBIATTACH in
the relevant locations.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Reviewed-by: Stefano Babic <sbabic@denx.de>
---
v2: Do not change the two places where the ifdef was "missing":
- in the parsing of swupdate.cfg;
- in the definition of struct swupdate_global_cfg.

If patch 1/2 is not applied, this patch is still relevant but then
with UBIVOL instead of UBIATTACH. I'll respin as needed.
---
 core/swupdate.c         | 8 ++++----
 doc/source/swupdate.rst | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/core/swupdate.c b/core/swupdate.c
index bc46e7a..b1e115d 100644
--- a/core/swupdate.c
+++ b/core/swupdate.c
@@ -85,7 +85,7 @@  static struct option long_options[] = {
 #ifdef CONFIG_ENCRYPTED_IMAGES
 	{"key-aes", required_argument, NULL, 'K'},
 #endif
-#ifdef CONFIG_MTD
+#ifdef CONFIG_UBIATTACH
 	{"blacklist", required_argument, NULL, 'b'},
 #endif
 	{"help", no_argument, NULL, 'h'},
@@ -115,7 +115,7 @@  static void usage(char *programname)
 			programname);
 	fprintf(stdout,
 		" -f, --file <filename>          : configuration file to use\n"
-#ifdef CONFIG_MTD
+#ifdef CONFIG_UBIATTACH
 		" -b, --blacklist <list of mtd>  : MTDs that must not be scanned for UBI\n"
 #endif
 		" -p, --postupdate               : execute post-update command\n"
@@ -667,7 +667,7 @@  int main(int argc, char **argv)
 		case 'v':
 			loglevel = TRACELEVEL;
 			break;
-#ifdef CONFIG_MTD
+#ifdef CONFIG_UBIATTACH
 		case 'b':
 			mtd_set_ubiblacklist(optarg);
 			break;
@@ -863,7 +863,7 @@  int main(int argc, char **argv)
 		}
 	}
 
-#ifdef CONFIG_MTD
+#ifdef CONFIG_UBIATTACH
 	if (strlen(swcfg.globals.mtdblacklist))
 		mtd_set_ubiblacklist(swcfg.globals.mtdblacklist);
 #endif
diff --git a/doc/source/swupdate.rst b/doc/source/swupdate.rst
index fa59383..75fc4fb 100644
--- a/doc/source/swupdate.rst
+++ b/doc/source/swupdate.rst
@@ -472,7 +472,7 @@  Command line parameters
 +=============+==========+============================================+
 | -f <file>   | string   | SWUpdate config file to use                |
 +-------------+----------+--------------------------------------------+
-| -b <string> | string   | Active only if CONFIG_MTD is set           |
+| -b <string> | string   | Active only if CONFIG_UBIATTACH is set     |
 |             |          | It allows to blacklist MTDs when SWUpdate  |
 |             |          | searches for UBI volumes.                  |
 |             |          | Example: U-Boot and environment in MTD0-1: |