diff options
author | Lubomir Rintel <lkundrak@v3.sk> | 2013-01-15 20:12:49 -0500 |
---|---|---|
committer | Artem Bityutskiy <artem.bityutskiy@linux.intel.com> | 2013-02-04 02:27:33 -0500 |
commit | f5f172dc031ace288c5bb5d18f0b956db08241c2 (patch) | |
tree | 15e3b0da06c0c6de126d278164f7ead19f6986ed /drivers/mtd | |
parent | f722689346afc1a0ed3fec8372c1762b6edc0c72 (diff) |
mtd: cmdlinepart: Make it into a module
All other partitioning schemes can be compiled as modules
Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r-- | drivers/mtd/Kconfig | 4 | ||||
-rw-r--r-- | drivers/mtd/cmdlinepart.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/mtd/Kconfig b/drivers/mtd/Kconfig index 73fcbbeb78d0..4dd3b38ddac0 100644 --- a/drivers/mtd/Kconfig +++ b/drivers/mtd/Kconfig | |||
@@ -74,8 +74,8 @@ config MTD_REDBOOT_PARTS_READONLY | |||
74 | endif # MTD_REDBOOT_PARTS | 74 | endif # MTD_REDBOOT_PARTS |
75 | 75 | ||
76 | config MTD_CMDLINE_PARTS | 76 | config MTD_CMDLINE_PARTS |
77 | bool "Command line partition table parsing" | 77 | tristate "Command line partition table parsing" |
78 | depends on MTD = "y" | 78 | depends on MTD |
79 | ---help--- | 79 | ---help--- |
80 | Allow generic configuration of the MTD partition tables via the kernel | 80 | Allow generic configuration of the MTD partition tables via the kernel |
81 | command line. Multiple flash resources are supported for hardware where | 81 | command line. Multiple flash resources are supported for hardware where |
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index 721d05c4ba8e..2e08fc45ce84 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c | |||
@@ -81,6 +81,7 @@ struct cmdline_mtd_partition { | |||
81 | static struct cmdline_mtd_partition *partitions; | 81 | static struct cmdline_mtd_partition *partitions; |
82 | 82 | ||
83 | /* the command line passed to mtdpart_setup() */ | 83 | /* the command line passed to mtdpart_setup() */ |
84 | static char *mtdparts; | ||
84 | static char *cmdline; | 85 | static char *cmdline; |
85 | static int cmdline_parsed; | 86 | static int cmdline_parsed; |
86 | 87 | ||
@@ -376,7 +377,7 @@ static int parse_cmdline_partitions(struct mtd_info *master, | |||
376 | * | 377 | * |
377 | * This function needs to be visible for bootloaders. | 378 | * This function needs to be visible for bootloaders. |
378 | */ | 379 | */ |
379 | static int mtdpart_setup(char *s) | 380 | static int __init mtdpart_setup(char *s) |
380 | { | 381 | { |
381 | cmdline = s; | 382 | cmdline = s; |
382 | return 1; | 383 | return 1; |
@@ -392,11 +393,16 @@ static struct mtd_part_parser cmdline_parser = { | |||
392 | 393 | ||
393 | static int __init cmdline_parser_init(void) | 394 | static int __init cmdline_parser_init(void) |
394 | { | 395 | { |
396 | if (mtdparts) | ||
397 | mtdpart_setup(mtdparts); | ||
395 | return register_mtd_parser(&cmdline_parser); | 398 | return register_mtd_parser(&cmdline_parser); |
396 | } | 399 | } |
397 | 400 | ||
398 | module_init(cmdline_parser_init); | 401 | module_init(cmdline_parser_init); |
399 | 402 | ||
403 | MODULE_PARM_DESC(mtdparts, "Partitioning specification"); | ||
404 | module_param(mtdparts, charp, 0); | ||
405 | |||
400 | MODULE_LICENSE("GPL"); | 406 | MODULE_LICENSE("GPL"); |
401 | MODULE_AUTHOR("Marius Groeger <mag@sysgo.de>"); | 407 | MODULE_AUTHOR("Marius Groeger <mag@sysgo.de>"); |
402 | MODULE_DESCRIPTION("Command line configuration of MTD partitions"); | 408 | MODULE_DESCRIPTION("Command line configuration of MTD partitions"); |