]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commit
mtd: move code adding (registering) partitions to the parse_mtd_partitions()
authorRafał Miłecki <rafal@milecki.pl>
Tue, 27 Mar 2018 20:35:41 +0000 (22:35 +0200)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 7 May 2018 08:10:47 +0000 (10:10 +0200)
commit5ac67ce36cfe38b4c104a42ce52c5c8d526f1c95
tree35f4c6c21fb1024b5352907d48e50df0b8129705
parent0fe3ede7941dfcd6fd540fc2b086453d3ee8f236
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>
drivers/mtd/mtdcore.c
drivers/mtd/mtdcore.h
drivers/mtd/mtdpart.c