Commit 6e14a61d authored by Axel Lin's avatar Axel Lin Committed by Brian Norris

mtd: make register_mtd_parser return void

register_mtd_parser never fails; hence make it return void.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent cf3b2b1e
...@@ -264,7 +264,8 @@ static struct mtd_part_parser afs_parser = { ...@@ -264,7 +264,8 @@ static struct mtd_part_parser afs_parser = {
static int __init afs_parser_init(void) static int __init afs_parser_init(void)
{ {
return register_mtd_parser(&afs_parser); register_mtd_parser(&afs_parser);
return 0;
} }
static void __exit afs_parser_exit(void) static void __exit afs_parser_exit(void)
......
...@@ -139,7 +139,8 @@ static struct mtd_part_parser ar7_parser = { ...@@ -139,7 +139,8 @@ static struct mtd_part_parser ar7_parser = {
static int __init ar7_parser_init(void) static int __init ar7_parser_init(void)
{ {
return register_mtd_parser(&ar7_parser); register_mtd_parser(&ar7_parser);
return 0;
} }
static void __exit ar7_parser_exit(void) static void __exit ar7_parser_exit(void)
......
...@@ -243,7 +243,8 @@ static struct mtd_part_parser bcm47xxpart_mtd_parser = { ...@@ -243,7 +243,8 @@ static struct mtd_part_parser bcm47xxpart_mtd_parser = {
static int __init bcm47xxpart_init(void) static int __init bcm47xxpart_init(void)
{ {
return register_mtd_parser(&bcm47xxpart_mtd_parser); register_mtd_parser(&bcm47xxpart_mtd_parser);
return 0;
} }
static void __exit bcm47xxpart_exit(void) static void __exit bcm47xxpart_exit(void)
......
...@@ -221,7 +221,8 @@ static struct mtd_part_parser bcm63xx_cfe_parser = { ...@@ -221,7 +221,8 @@ static struct mtd_part_parser bcm63xx_cfe_parser = {
static int __init bcm63xx_cfe_parser_init(void) static int __init bcm63xx_cfe_parser_init(void)
{ {
return register_mtd_parser(&bcm63xx_cfe_parser); register_mtd_parser(&bcm63xx_cfe_parser);
return 0;
} }
static void __exit bcm63xx_cfe_parser_exit(void) static void __exit bcm63xx_cfe_parser_exit(void)
......
...@@ -395,7 +395,8 @@ static int __init cmdline_parser_init(void) ...@@ -395,7 +395,8 @@ static int __init cmdline_parser_init(void)
{ {
if (mtdparts) if (mtdparts)
mtdpart_setup(mtdparts); mtdpart_setup(mtdparts);
return register_mtd_parser(&cmdline_parser); register_mtd_parser(&cmdline_parser);
return 0;
} }
static void __exit cmdline_parser_exit(void) static void __exit cmdline_parser_exit(void)
......
...@@ -672,13 +672,11 @@ static struct mtd_part_parser *get_partition_parser(const char *name) ...@@ -672,13 +672,11 @@ static struct mtd_part_parser *get_partition_parser(const char *name)
#define put_partition_parser(p) do { module_put((p)->owner); } while (0) #define put_partition_parser(p) do { module_put((p)->owner); } while (0)
int register_mtd_parser(struct mtd_part_parser *p) void register_mtd_parser(struct mtd_part_parser *p)
{ {
spin_lock(&part_parser_lock); spin_lock(&part_parser_lock);
list_add(&p->list, &part_parsers); list_add(&p->list, &part_parsers);
spin_unlock(&part_parser_lock); spin_unlock(&part_parser_lock);
return 0;
} }
EXPORT_SYMBOL_GPL(register_mtd_parser); EXPORT_SYMBOL_GPL(register_mtd_parser);
......
...@@ -173,18 +173,9 @@ static struct mtd_part_parser ofoldpart_parser = { ...@@ -173,18 +173,9 @@ static struct mtd_part_parser ofoldpart_parser = {
static int __init ofpart_parser_init(void) static int __init ofpart_parser_init(void)
{ {
int rc; register_mtd_parser(&ofpart_parser);
rc = register_mtd_parser(&ofpart_parser); register_mtd_parser(&ofoldpart_parser);
if (rc)
goto out;
rc = register_mtd_parser(&ofoldpart_parser);
if (!rc)
return 0; return 0;
deregister_mtd_parser(&ofoldpart_parser);
out:
return rc;
} }
static void __exit ofpart_parser_exit(void) static void __exit ofpart_parser_exit(void)
......
...@@ -300,7 +300,8 @@ MODULE_ALIAS("RedBoot"); ...@@ -300,7 +300,8 @@ MODULE_ALIAS("RedBoot");
static int __init redboot_parser_init(void) static int __init redboot_parser_init(void)
{ {
return register_mtd_parser(&redboot_parser); register_mtd_parser(&redboot_parser);
return 0;
} }
static void __exit redboot_parser_exit(void) static void __exit redboot_parser_exit(void)
......
...@@ -76,7 +76,7 @@ struct mtd_part_parser { ...@@ -76,7 +76,7 @@ struct mtd_part_parser {
struct mtd_part_parser_data *); struct mtd_part_parser_data *);
}; };
extern int register_mtd_parser(struct mtd_part_parser *parser); extern void register_mtd_parser(struct mtd_part_parser *parser);
extern void deregister_mtd_parser(struct mtd_part_parser *parser); extern void deregister_mtd_parser(struct mtd_part_parser *parser);
int mtd_is_partition(const struct mtd_info *mtd); int mtd_is_partition(const struct mtd_info *mtd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment