diff options
author | Rafał Miłecki <rafal@milecki.pl> | 2018-03-27 23:35:41 +0300 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@bootlin.com> | 2018-05-07 11:10:47 +0300 |
commit | 5ac67ce36cfe38b4c104a42ce52c5c8d526f1c95 (patch) | |
tree | 35f4c6c21fb1024b5352907d48e50df0b8129705 /drivers/mtd/mtdcore.h | |
parent | 0fe3ede7941dfcd6fd540fc2b086453d3ee8f236 (diff) | |
download | linux-5ac67ce36cfe38b4c104a42ce52c5c8d526f1c95.tar.xz |
mtd: move code adding (registering) partitions to the parse_mtd_partitions()
This commit slightly simplifies the code. Every parse_mtd_partitions()
caller (out of two existing ones) had to add partitions & cleanup parser
on its own. This moves that responsibility into the function.
That change also allows dropping struct mtd_partitions argument.
There is one minor behavior change caused by this cleanup. If
parse_mtd_partitions() fails to add partitions (add_mtd_partitions()
return an error) then mtd_device_parse_register() will still try to
add (register) fallback partitions. It's a real corner case affecting
one of uncommon error paths and shouldn't cause any harm.
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Diffstat (limited to 'drivers/mtd/mtdcore.h')
-rw-r--r-- | drivers/mtd/mtdcore.h | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/mtd/mtdcore.h b/drivers/mtd/mtdcore.h index 37accfd0400e..9887bda317cd 100644 --- a/drivers/mtd/mtdcore.h +++ b/drivers/mtd/mtdcore.h @@ -15,7 +15,6 @@ int del_mtd_partitions(struct mtd_info *); struct mtd_partitions; int parse_mtd_partitions(struct mtd_info *master, const char * const *types, - struct mtd_partitions *pparts, struct mtd_part_parser_data *data); void mtd_part_parser_cleanup(struct mtd_partitions *parts); |