mtd: mtdpart: Do not fail mtd probe when parsing partitions fails
authorBrian Norris <computersforpeace@gmail.com>
Sun, 11 Oct 2015 20:03:47 +0000 (13:03 -0700)
committerBrian Norris <computersforpeace@gmail.com>
Tue, 27 Oct 2015 01:43:48 +0000 (18:43 -0700)
commit5a2415b0769233194f20d3906c3ffc6a2033317c
tree355fb4bd34fa3b04832e80c7b7f3250d4f65dac5
parent04850c4d8613127a9b488321c0ad83bff7519311
mtd: mtdpart: Do not fail mtd probe when parsing partitions fails

Due to wrong assumption in ofpart ofpart fails on Exynos on SPI chips
with no partitions because the subnode containing controller data
confuses the ofpart parser.

Thus compiling in ofpart support automatically fails probing any SPI NOR
flash without partitions on Exynos.

Compiling in a partitioning scheme should not cause probe of otherwise
valid device to fail.

Instead, let's do the following:
 * try parsers until one succeeds
 * if no parser succeeds, report the first error we saw
 * even in the failure case, allow MTD to probe, with fallback
   partitions or no partitions at all -- the master device will still be
   registered

Issue report and comments initially by Michal Suchanek.

Reported-by: Michal Suchanek <hramrach@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
drivers/mtd/mtdcore.c
drivers/mtd/mtdpart.c