• Rafał Miłecki's avatar
    mtd: move code adding (registering) partitions to the parse_mtd_partitions() · 5ac67ce3
    Rafał Miłecki authored
    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: default avatarRafał Miłecki <rafal@milecki.pl>
    Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
mtdcore.h 880 Bytes