Skip to content

Commit f5f172d

Browse files
lkundrakdedekind
authored andcommitted
mtd: cmdlinepart: Make it into a module
All other partitioning schemes can be compiled as modules Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Artem Bityutskiy <[email protected]>
1 parent f722689 commit f5f172d

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

drivers/mtd/Kconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ config MTD_REDBOOT_PARTS_READONLY
7474
endif # MTD_REDBOOT_PARTS
7575

7676
config MTD_CMDLINE_PARTS
77-
bool "Command line partition table parsing"
78-
depends on MTD = "y"
77+
tristate "Command line partition table parsing"
78+
depends on MTD
7979
---help---
8080
Allow generic configuration of the MTD partition tables via the kernel
8181
command line. Multiple flash resources are supported for hardware where

drivers/mtd/cmdlinepart.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ struct cmdline_mtd_partition {
8181
static struct cmdline_mtd_partition *partitions;
8282

8383
/* the command line passed to mtdpart_setup() */
84+
static char *mtdparts;
8485
static char *cmdline;
8586
static int cmdline_parsed;
8687

@@ -376,7 +377,7 @@ static int parse_cmdline_partitions(struct mtd_info *master,
376377
*
377378
* This function needs to be visible for bootloaders.
378379
*/
379-
static int mtdpart_setup(char *s)
380+
static int __init mtdpart_setup(char *s)
380381
{
381382
cmdline = s;
382383
return 1;
@@ -392,11 +393,16 @@ static struct mtd_part_parser cmdline_parser = {
392393

393394
static int __init cmdline_parser_init(void)
394395
{
396+
if (mtdparts)
397+
mtdpart_setup(mtdparts);
395398
return register_mtd_parser(&cmdline_parser);
396399
}
397400

398401
module_init(cmdline_parser_init);
399402

403+
MODULE_PARM_DESC(mtdparts, "Partitioning specification");
404+
module_param(mtdparts, charp, 0);
405+
400406
MODULE_LICENSE("GPL");
401407
MODULE_AUTHOR("Marius Groeger <[email protected]>");
402408
MODULE_DESCRIPTION("Command line configuration of MTD partitions");

0 commit comments

Comments
 (0)