mtd: spi-nor: allow registering multiple MTDs when DM is enabled
Currently when the SPI_FLASH_MTD config option is enabled, only one SPI
can be registered as MTD at any time - it is the last one probed (since
with old non-DM model only one SPI NOR could be probed at any time).
When DM is enabled, allow for registering multiple SPI NORs as MTDs by
utilizing the nor->mtd structure, which is filled in by spi_nor_scan
anyway, instead of filling a separate struct mtd_info.
Signed-off-by: Marek Behún <[email protected]>
Reviewed-by: Pali Rohár <[email protected]>
Reviewed-by: Miquel Raynal <[email protected]>
Tested-by: Patrice Chotard <[email protected]>
Reviewed-by: Jagan Teki <[email protected]>
Cc: Priyanka Jain <[email protected]>
Cc: Simon Glass <[email protected]>
Cc: Heiko Schocher <[email protected]>
Cc: Patrick Delaunay <[email protected]>