* [PATCH 1/2] mtd: cmdlinepart: Make it into a module
@ 2013-01-16 1:12 Lubomir Rintel
2013-01-16 1:12 ` [PATCH 2/2] mtd: Allow removal of partitioning modules Lubomir Rintel
2013-01-18 8:04 ` [PATCH 1/2] mtd: cmdlinepart: Make it into a module Artem Bityutskiy
0 siblings, 2 replies; 3+ messages in thread
From: Lubomir Rintel @ 2013-01-16 1:12 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd, linux-kernel, Lubomir Rintel
All other partitioning schemes can be compiled as modules
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/mtd/Kconfig | 4 ++--
drivers/mtd/cmdlinepart.c | 8 +++++++-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig
index 73fcbbe..4dd3b38 100644
--- a/drivers/mtd/Kconfig
+++ b/drivers/mtd/Kconfig
@@ -74,8 +74,8 @@ config MTD_REDBOOT_PARTS_READONLY
endif # MTD_REDBOOT_PARTS
config MTD_CMDLINE_PARTS
- bool "Command line partition table parsing"
- depends on MTD = "y"
+ tristate "Command line partition table parsing"
+ depends on MTD
---help---
Allow generic configuration of the MTD partition tables via the kernel
command line. Multiple flash resources are supported for hardware where
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index aed1b8a..a2bb2ea 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -70,6 +70,7 @@ struct cmdline_mtd_partition {
static struct cmdline_mtd_partition *partitions;
/* the command line passed to mtdpart_setup() */
+static char *mtdparts;
static char *cmdline;
static int cmdline_parsed;
@@ -360,7 +361,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
*
* This function needs to be visible for bootloaders.
*/
-static int mtdpart_setup(char *s)
+static int __init mtdpart_setup(char *s)
{
cmdline = s;
return 1;
@@ -376,11 +377,16 @@ static struct mtd_part_parser cmdline_parser = {
static int __init cmdline_parser_init(void)
{
+ if (mtdparts)
+ mtdpart_setup(mtdparts);
return register_mtd_parser(&cmdline_parser);
}
module_init(cmdline_parser_init);
+MODULE_PARM_DESC(mtdparts, "Partitioning specification");
+module_param(mtdparts, charp, 0);
+
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Marius Groeger <mag@sysgo.de>");
MODULE_DESCRIPTION("Command line configuration of MTD partitions");
--
1.7.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH 2/2] mtd: Allow removal of partitioning modules
2013-01-16 1:12 [PATCH 1/2] mtd: cmdlinepart: Make it into a module Lubomir Rintel
@ 2013-01-16 1:12 ` Lubomir Rintel
2013-01-18 8:04 ` [PATCH 1/2] mtd: cmdlinepart: Make it into a module Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Lubomir Rintel @ 2013-01-16 1:12 UTC (permalink / raw)
To: David Woodhouse; +Cc: linux-mtd, linux-kernel, Lubomir Rintel
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
---
drivers/mtd/ar7part.c | 6 ++++++
drivers/mtd/cmdlinepart.c | 6 ++++++
drivers/mtd/ofpart.c | 7 +++++++
3 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c
index 9453931..a98899f 100644
--- a/drivers/mtd/ar7part.c
+++ b/drivers/mtd/ar7part.c
@@ -145,7 +145,13 @@ static int __init ar7_parser_init(void)
return register_mtd_parser(&ar7_parser);
}
+static void __exit ar7_parser_exit(void)
+{
+ deregister_mtd_parser(&ar7_parser);
+}
+
module_init(ar7_parser_init);
+module_exit(ar7_parser_exit);
MODULE_LICENSE("GPL");
MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, "
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c
index a2bb2ea..8689a77 100644
--- a/drivers/mtd/cmdlinepart.c
+++ b/drivers/mtd/cmdlinepart.c
@@ -382,7 +382,13 @@ static int __init cmdline_parser_init(void)
return register_mtd_parser(&cmdline_parser);
}
+static void __exit cmdline_parser_exit(void)
+{
+ deregister_mtd_parser(&cmdline_parser);
+}
+
module_init(cmdline_parser_init);
+module_exit(cmdline_parser_exit);
MODULE_PARM_DESC(mtdparts, "Partitioning specification");
module_param(mtdparts, charp, 0);
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
index d9127e2..d407e0b 100644
--- a/drivers/mtd/ofpart.c
+++ b/drivers/mtd/ofpart.c
@@ -171,7 +171,14 @@ out:
return rc;
}
+static void __exit ofpart_parser_exit(void)
+{
+ deregister_mtd_parser(&ofpart_parser);
+ deregister_mtd_parser(&ofoldpart_parser);
+}
+
module_init(ofpart_parser_init);
+module_exit(ofpart_parser_exit);
MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Parser for MTD partitioning information in device tree");
--
1.7.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 1/2] mtd: cmdlinepart: Make it into a module
2013-01-16 1:12 [PATCH 1/2] mtd: cmdlinepart: Make it into a module Lubomir Rintel
2013-01-16 1:12 ` [PATCH 2/2] mtd: Allow removal of partitioning modules Lubomir Rintel
@ 2013-01-18 8:04 ` Artem Bityutskiy
1 sibling, 0 replies; 3+ messages in thread
From: Artem Bityutskiy @ 2013-01-18 8:04 UTC (permalink / raw)
To: Lubomir Rintel; +Cc: David Woodhouse, linux-mtd, linux-kernel
[-- Attachment #1: Type: text/plain, Size: 251 bytes --]
On Wed, 2013-01-16 at 02:12 +0100, Lubomir Rintel wrote:
> All other partitioning schemes can be compiled as modules
>
> Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Both pushed to l2-mtd.git, thanks!
--
Best Regards,
Artem Bityutskiy
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-01-18 8:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-16 1:12 [PATCH 1/2] mtd: cmdlinepart: Make it into a module Lubomir Rintel
2013-01-16 1:12 ` [PATCH 2/2] mtd: Allow removal of partitioning modules Lubomir Rintel
2013-01-18 8:04 ` [PATCH 1/2] mtd: cmdlinepart: Make it into a module Artem Bityutskiy
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®