mtd: get rid of the mtd_add_device_partitions()
authorRafał Miłecki <rafal@milecki.pl>
Tue, 16 Jan 2018 15:45:42 +0000 (16:45 +0100)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Mon, 12 Feb 2018 12:39:20 +0000 (13:39 +0100)
commit0dbe4ea78d69756efeb0bba0764f6bd4a9ee9567
tree62b0d3e98ec1d6d8375c3ce7655737ccc786c166
parent2c77c57d22adb05b21cdb333a0c42bdfa0e19835
mtd: get rid of the mtd_add_device_partitions()

This simplifies code a bit by:
1) Avoiding an extra (tiny) function
2) Checking for amount of parsed (found) partitions just once
3) Avoiding clearing/filling struct mtd_partitions manually

With this commit proper functions are called directly from the
mtd_device_parse_register(). It doesn't need to use minor tricks like
memsetting struct to 0 to trigger an expected
mtd_add_device_partitions() behavior.

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