]> git.baikalelectronics.ru Git - kernel.git/commit
mtd: move code adding master MTD out of mtd_add_device_partitions()
authorRafał Miłecki <rafal@milecki.pl>
Tue, 16 Jan 2018 15:45:41 +0000 (16:45 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 12 Feb 2018 12:39:20 +0000 (13:39 +0100)
commit1a749319fe206a12ed82651ffdd84139c7751a9d
tree821360f17fd8dc64e1704aea7cf88f839519ff00
parentb2c8db2e1de88dcbe91e2d1826fc5e17dae36741
mtd: move code adding master MTD out of mtd_add_device_partitions()

This change is a small cleanup of mtd_device_parse_register(). When
using MTD_PARTITIONED_MASTER it makes sure a master MTD is registered
before dealing with partitions. The advantage of this is not mixing
code handling master MTD with code handling partitions.

This commit doesn't change any behavior except from a slightly different
failure code path. The new code may need to call del_mtd_device when
something goes wrong.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/mtdcore.c