mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-23 17:30:02 +00:00
mtd: kill off MTD partition parser boilerplate
Most parsers can be handled with our new boilerplate-reducing macro. There are a few that can't be (cmdlineparts and ofpart). Also kill off the owner assignments, since register_mtd_parser() now takes care of that. Signed-off-by: Brian Norris <computersforpeace@gmail.com>
This commit is contained in:
parent
b9eab01125
commit
b8f70badb8
7 changed files with 5 additions and 80 deletions
|
@ -256,25 +256,10 @@ static int parse_afs_partitions(struct mtd_info *mtd,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtd_part_parser afs_parser = {
|
static struct mtd_part_parser afs_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = parse_afs_partitions,
|
.parse_fn = parse_afs_partitions,
|
||||||
.name = "afs",
|
.name = "afs",
|
||||||
};
|
};
|
||||||
|
module_mtd_part_parser(afs_parser);
|
||||||
static int __init afs_parser_init(void)
|
|
||||||
{
|
|
||||||
register_mtd_parser(&afs_parser);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __exit afs_parser_exit(void)
|
|
||||||
{
|
|
||||||
deregister_mtd_parser(&afs_parser);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(afs_parser_init);
|
|
||||||
module_exit(afs_parser_exit);
|
|
||||||
|
|
||||||
|
|
||||||
MODULE_AUTHOR("ARM Ltd");
|
MODULE_AUTHOR("ARM Ltd");
|
||||||
MODULE_DESCRIPTION("ARM Firmware Suite partition parser");
|
MODULE_DESCRIPTION("ARM Firmware Suite partition parser");
|
||||||
|
|
|
@ -132,24 +132,10 @@ static int create_mtd_partitions(struct mtd_info *master,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtd_part_parser ar7_parser = {
|
static struct mtd_part_parser ar7_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = create_mtd_partitions,
|
.parse_fn = create_mtd_partitions,
|
||||||
.name = "ar7part",
|
.name = "ar7part",
|
||||||
};
|
};
|
||||||
|
module_mtd_part_parser(ar7_parser);
|
||||||
static int __init ar7_parser_init(void)
|
|
||||||
{
|
|
||||||
register_mtd_parser(&ar7_parser);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
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_LICENSE("GPL");
|
||||||
MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, "
|
MODULE_AUTHOR( "Felix Fietkau <nbd@openwrt.org>, "
|
||||||
|
|
|
@ -313,24 +313,10 @@ static int bcm47xxpart_parse(struct mtd_info *master,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct mtd_part_parser bcm47xxpart_mtd_parser = {
|
static struct mtd_part_parser bcm47xxpart_mtd_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = bcm47xxpart_parse,
|
.parse_fn = bcm47xxpart_parse,
|
||||||
.name = "bcm47xxpart",
|
.name = "bcm47xxpart",
|
||||||
};
|
};
|
||||||
|
module_mtd_part_parser(bcm47xxpart_mtd_parser);
|
||||||
static int __init bcm47xxpart_init(void)
|
|
||||||
{
|
|
||||||
register_mtd_parser(&bcm47xxpart_mtd_parser);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __exit bcm47xxpart_exit(void)
|
|
||||||
{
|
|
||||||
deregister_mtd_parser(&bcm47xxpart_mtd_parser);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(bcm47xxpart_init);
|
|
||||||
module_exit(bcm47xxpart_exit);
|
|
||||||
|
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
MODULE_DESCRIPTION("MTD partitioning for BCM47XX flash memories");
|
MODULE_DESCRIPTION("MTD partitioning for BCM47XX flash memories");
|
||||||
|
|
|
@ -214,24 +214,10 @@ static int bcm63xx_parse_cfe_partitions(struct mtd_info *master,
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct mtd_part_parser bcm63xx_cfe_parser = {
|
static struct mtd_part_parser bcm63xx_cfe_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = bcm63xx_parse_cfe_partitions,
|
.parse_fn = bcm63xx_parse_cfe_partitions,
|
||||||
.name = "bcm63xxpart",
|
.name = "bcm63xxpart",
|
||||||
};
|
};
|
||||||
|
module_mtd_part_parser(bcm63xx_cfe_parser);
|
||||||
static int __init bcm63xx_cfe_parser_init(void)
|
|
||||||
{
|
|
||||||
register_mtd_parser(&bcm63xx_cfe_parser);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __exit bcm63xx_cfe_parser_exit(void)
|
|
||||||
{
|
|
||||||
deregister_mtd_parser(&bcm63xx_cfe_parser);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(bcm63xx_cfe_parser_init);
|
|
||||||
module_exit(bcm63xx_cfe_parser_exit);
|
|
||||||
|
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
MODULE_AUTHOR("Daniel Dickinson <openwrt@cshore.neomailbox.net>");
|
MODULE_AUTHOR("Daniel Dickinson <openwrt@cshore.neomailbox.net>");
|
||||||
|
|
|
@ -382,7 +382,6 @@ static int __init mtdpart_setup(char *s)
|
||||||
__setup("mtdparts=", mtdpart_setup);
|
__setup("mtdparts=", mtdpart_setup);
|
||||||
|
|
||||||
static struct mtd_part_parser cmdline_parser = {
|
static struct mtd_part_parser cmdline_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = parse_cmdline_partitions,
|
.parse_fn = parse_cmdline_partitions,
|
||||||
.name = "cmdlinepart",
|
.name = "cmdlinepart",
|
||||||
};
|
};
|
||||||
|
|
|
@ -131,7 +131,6 @@ static int parse_ofpart_partitions(struct mtd_info *master,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtd_part_parser ofpart_parser = {
|
static struct mtd_part_parser ofpart_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = parse_ofpart_partitions,
|
.parse_fn = parse_ofpart_partitions,
|
||||||
.name = "ofpart",
|
.name = "ofpart",
|
||||||
};
|
};
|
||||||
|
@ -191,7 +190,6 @@ static int parse_ofoldpart_partitions(struct mtd_info *master,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtd_part_parser ofoldpart_parser = {
|
static struct mtd_part_parser ofoldpart_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = parse_ofoldpart_partitions,
|
.parse_fn = parse_ofoldpart_partitions,
|
||||||
.name = "ofoldpart",
|
.name = "ofoldpart",
|
||||||
};
|
};
|
||||||
|
|
|
@ -290,28 +290,13 @@ static int parse_redboot_partitions(struct mtd_info *master,
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct mtd_part_parser redboot_parser = {
|
static struct mtd_part_parser redboot_parser = {
|
||||||
.owner = THIS_MODULE,
|
|
||||||
.parse_fn = parse_redboot_partitions,
|
.parse_fn = parse_redboot_partitions,
|
||||||
.name = "RedBoot",
|
.name = "RedBoot",
|
||||||
};
|
};
|
||||||
|
module_mtd_part_parser(redboot_parser);
|
||||||
|
|
||||||
/* mtd parsers will request the module by parser name */
|
/* mtd parsers will request the module by parser name */
|
||||||
MODULE_ALIAS("RedBoot");
|
MODULE_ALIAS("RedBoot");
|
||||||
|
|
||||||
static int __init redboot_parser_init(void)
|
|
||||||
{
|
|
||||||
register_mtd_parser(&redboot_parser);
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void __exit redboot_parser_exit(void)
|
|
||||||
{
|
|
||||||
deregister_mtd_parser(&redboot_parser);
|
|
||||||
}
|
|
||||||
|
|
||||||
module_init(redboot_parser_init);
|
|
||||||
module_exit(redboot_parser_exit);
|
|
||||||
|
|
||||||
MODULE_LICENSE("GPL");
|
MODULE_LICENSE("GPL");
|
||||||
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
|
MODULE_AUTHOR("David Woodhouse <dwmw2@infradead.org>");
|
||||||
MODULE_DESCRIPTION("Parsing code for RedBoot Flash Image System (FIS) tables");
|
MODULE_DESCRIPTION("Parsing code for RedBoot Flash Image System (FIS) tables");
|
||||||
|
|
Loading…
Reference in a new issue