mtd: spi-nor: don't drop sfdp data if optional parsers fail
authorTudor.Ambarus@microchip.com <Tudor.Ambarus@microchip.com>
Fri, 9 Nov 2018 16:56:48 +0000 (16:56 +0000)
committerBoris Brezillon <boris.brezillon@bootlin.com>
Tue, 13 Nov 2018 19:37:34 +0000 (20:37 +0100)
commitcd5e6d79384eb2dd47de6cb9569150053d4a6803
treecea4aa4acb1c846bf208d79fd39f016d056016a9
parentccda4af0f4b92f7b4c308d3acc262f4a7e3affad
mtd: spi-nor: don't drop sfdp data if optional parsers fail

JESD216C states that just the Basic Flash Parameter Table is mandatory.
Already defined (or future) additional parameter headers and tables are
optional.

Don't drop already collected sfdp data in case an optional table
parser fails. In case of failing, each optional parser is responsible
to roll back to the previously known spi_nor data.

Fixes: b038e8e3be72 ("mtd: spi-nor: parse SFDP Sector Map Parameter Table")
Reported-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Suggested-by: Boris Brezillon <boris.brezillon@bootlin.com>
Signed-off-by: Tudor Ambarus <tudor.ambarus@microchip.com>
Tested-by: Yogesh Gaur <yogeshnarayan.gaur@nxp.com>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
drivers/mtd/spi-nor/spi-nor.c