diff options
author | Axel Lin <axel.lin@ingics.com> | 2013-12-01 06:01:06 -0500 |
---|---|---|
committer | Brian Norris <computersforpeace@gmail.com> | 2014-01-03 14:22:22 -0500 |
commit | 6e14a61d412eb87ef7bdcec8b08a95bead771a78 (patch) | |
tree | 485dff0b5de49c083b1d04c81881c99a45a71063 | |
parent | cf3b2b1e24998ba67ca6defa71899bee2432046f (diff) |
mtd: make register_mtd_parser return void
register_mtd_parser never fails; hence make it return void.
Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
-rw-r--r-- | drivers/mtd/afs.c | 3 | ||||
-rw-r--r-- | drivers/mtd/ar7part.c | 3 | ||||
-rw-r--r-- | drivers/mtd/bcm47xxpart.c | 3 | ||||
-rw-r--r-- | drivers/mtd/bcm63xxpart.c | 3 | ||||
-rw-r--r-- | drivers/mtd/cmdlinepart.c | 3 | ||||
-rw-r--r-- | drivers/mtd/mtdpart.c | 4 | ||||
-rw-r--r-- | drivers/mtd/ofpart.c | 15 | ||||
-rw-r--r-- | drivers/mtd/redboot.c | 3 | ||||
-rw-r--r-- | include/linux/mtd/partitions.h | 2 |
9 files changed, 17 insertions, 22 deletions
diff --git a/drivers/mtd/afs.c b/drivers/mtd/afs.c index 5a3942bf109c..96a33e3f7b00 100644 --- a/drivers/mtd/afs.c +++ b/drivers/mtd/afs.c | |||
@@ -264,7 +264,8 @@ static struct mtd_part_parser afs_parser = { | |||
264 | 264 | ||
265 | static int __init afs_parser_init(void) | 265 | static int __init afs_parser_init(void) |
266 | { | 266 | { |
267 | return register_mtd_parser(&afs_parser); | 267 | register_mtd_parser(&afs_parser); |
268 | return 0; | ||
268 | } | 269 | } |
269 | 270 | ||
270 | static void __exit afs_parser_exit(void) | 271 | static void __exit afs_parser_exit(void) |
diff --git a/drivers/mtd/ar7part.c b/drivers/mtd/ar7part.c index ddc0a4287a4b..7c9172ad2621 100644 --- a/drivers/mtd/ar7part.c +++ b/drivers/mtd/ar7part.c | |||
@@ -139,7 +139,8 @@ static struct mtd_part_parser ar7_parser = { | |||
139 | 139 | ||
140 | static int __init ar7_parser_init(void) | 140 | static int __init ar7_parser_init(void) |
141 | { | 141 | { |
142 | return register_mtd_parser(&ar7_parser); | 142 | register_mtd_parser(&ar7_parser); |
143 | return 0; | ||
143 | } | 144 | } |
144 | 145 | ||
145 | static void __exit ar7_parser_exit(void) | 146 | static void __exit ar7_parser_exit(void) |
diff --git a/drivers/mtd/bcm47xxpart.c b/drivers/mtd/bcm47xxpart.c index 7a6384b0962a..931746ded989 100644 --- a/drivers/mtd/bcm47xxpart.c +++ b/drivers/mtd/bcm47xxpart.c | |||
@@ -243,7 +243,8 @@ static struct mtd_part_parser bcm47xxpart_mtd_parser = { | |||
243 | 243 | ||
244 | static int __init bcm47xxpart_init(void) | 244 | static int __init bcm47xxpart_init(void) |
245 | { | 245 | { |
246 | return register_mtd_parser(&bcm47xxpart_mtd_parser); | 246 | register_mtd_parser(&bcm47xxpart_mtd_parser); |
247 | return 0; | ||
247 | } | 248 | } |
248 | 249 | ||
249 | static void __exit bcm47xxpart_exit(void) | 250 | static void __exit bcm47xxpart_exit(void) |
diff --git a/drivers/mtd/bcm63xxpart.c b/drivers/mtd/bcm63xxpart.c index 5c813907661c..b2443f7031c9 100644 --- a/drivers/mtd/bcm63xxpart.c +++ b/drivers/mtd/bcm63xxpart.c | |||
@@ -221,7 +221,8 @@ static struct mtd_part_parser bcm63xx_cfe_parser = { | |||
221 | 221 | ||
222 | static int __init bcm63xx_cfe_parser_init(void) | 222 | static int __init bcm63xx_cfe_parser_init(void) |
223 | { | 223 | { |
224 | return register_mtd_parser(&bcm63xx_cfe_parser); | 224 | register_mtd_parser(&bcm63xx_cfe_parser); |
225 | return 0; | ||
225 | } | 226 | } |
226 | 227 | ||
227 | static void __exit bcm63xx_cfe_parser_exit(void) | 228 | static void __exit bcm63xx_cfe_parser_exit(void) |
diff --git a/drivers/mtd/cmdlinepart.c b/drivers/mtd/cmdlinepart.c index 721caebbc5cc..3e829b37af8d 100644 --- a/drivers/mtd/cmdlinepart.c +++ b/drivers/mtd/cmdlinepart.c | |||
@@ -395,7 +395,8 @@ static int __init cmdline_parser_init(void) | |||
395 | { | 395 | { |
396 | if (mtdparts) | 396 | if (mtdparts) |
397 | mtdpart_setup(mtdparts); | 397 | mtdpart_setup(mtdparts); |
398 | return register_mtd_parser(&cmdline_parser); | 398 | register_mtd_parser(&cmdline_parser); |
399 | return 0; | ||
399 | } | 400 | } |
400 | 401 | ||
401 | static void __exit cmdline_parser_exit(void) | 402 | static void __exit cmdline_parser_exit(void) |
diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c index 29ee91e6a70f..3c7d6d7623c1 100644 --- a/drivers/mtd/mtdpart.c +++ b/drivers/mtd/mtdpart.c | |||
@@ -672,13 +672,11 @@ static struct mtd_part_parser *get_partition_parser(const char *name) | |||
672 | 672 | ||
673 | #define put_partition_parser(p) do { module_put((p)->owner); } while (0) | 673 | #define put_partition_parser(p) do { module_put((p)->owner); } while (0) |
674 | 674 | ||
675 | int register_mtd_parser(struct mtd_part_parser *p) | 675 | void register_mtd_parser(struct mtd_part_parser *p) |
676 | { | 676 | { |
677 | spin_lock(&part_parser_lock); | 677 | spin_lock(&part_parser_lock); |
678 | list_add(&p->list, &part_parsers); | 678 | list_add(&p->list, &part_parsers); |
679 | spin_unlock(&part_parser_lock); | 679 | spin_unlock(&part_parser_lock); |
680 | |||
681 | return 0; | ||
682 | } | 680 | } |
683 | EXPORT_SYMBOL_GPL(register_mtd_parser); | 681 | EXPORT_SYMBOL_GPL(register_mtd_parser); |
684 | 682 | ||
diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c index f0a708bf9b0e..aa26c32e1bc2 100644 --- a/drivers/mtd/ofpart.c +++ b/drivers/mtd/ofpart.c | |||
@@ -173,18 +173,9 @@ static struct mtd_part_parser ofoldpart_parser = { | |||
173 | 173 | ||
174 | static int __init ofpart_parser_init(void) | 174 | static int __init ofpart_parser_init(void) |
175 | { | 175 | { |
176 | int rc; | 176 | register_mtd_parser(&ofpart_parser); |
177 | rc = register_mtd_parser(&ofpart_parser); | 177 | register_mtd_parser(&ofoldpart_parser); |
178 | if (rc) | 178 | return 0; |
179 | goto out; | ||
180 | |||
181 | rc = register_mtd_parser(&ofoldpart_parser); | ||
182 | if (!rc) | ||
183 | return 0; | ||
184 | |||
185 | deregister_mtd_parser(&ofoldpart_parser); | ||
186 | out: | ||
187 | return rc; | ||
188 | } | 179 | } |
189 | 180 | ||
190 | static void __exit ofpart_parser_exit(void) | 181 | static void __exit ofpart_parser_exit(void) |
diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c index 580035c803d6..5da911ebdf49 100644 --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c | |||
@@ -300,7 +300,8 @@ MODULE_ALIAS("RedBoot"); | |||
300 | 300 | ||
301 | static int __init redboot_parser_init(void) | 301 | static int __init redboot_parser_init(void) |
302 | { | 302 | { |
303 | return register_mtd_parser(&redboot_parser); | 303 | register_mtd_parser(&redboot_parser); |
304 | return 0; | ||
304 | } | 305 | } |
305 | 306 | ||
306 | static void __exit redboot_parser_exit(void) | 307 | static void __exit redboot_parser_exit(void) |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index d513ffbd8043..6a35e6de5da1 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -76,7 +76,7 @@ struct mtd_part_parser { | |||
76 | struct mtd_part_parser_data *); | 76 | struct mtd_part_parser_data *); |
77 | }; | 77 | }; |
78 | 78 | ||
79 | extern int register_mtd_parser(struct mtd_part_parser *parser); | 79 | extern void register_mtd_parser(struct mtd_part_parser *parser); |
80 | extern void deregister_mtd_parser(struct mtd_part_parser *parser); | 80 | extern void deregister_mtd_parser(struct mtd_part_parser *parser); |
81 | 81 | ||
82 | int mtd_is_partition(const struct mtd_info *mtd); | 82 | int mtd_is_partition(const struct mtd_info *mtd); |