]> git.baikalelectronics.ru Git - uboot.git/commit
mtd: spi-nor: allow registering multiple MTDs when DM is enabled
authorMarek Behún <marek.behun@nic.cz>
Wed, 26 May 2021 12:08:20 +0000 (14:08 +0200)
committerJagan Teki <jagan@amarulasolutions.com>
Thu, 24 Jun 2021 06:23:31 +0000 (11:53 +0530)
commite17dc9227c709bf3c99ac9b096c6c165d3c6c6b5
tree0a8638edd3b39da21d35320429f0a13ae37cdbf0
parentdd6686d04a3639ae2f523078219116dd0f7a97aa
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 <marek.behun@nic.cz>
Reviewed-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Miquel Raynal <miquel.raynal@bootlin.com>
Tested-by: Patrice Chotard <patrice.chotard@foss.st.com>
Reviewed-by: Jagan Teki <jagan@amarulasolutions.com>
Cc: Priyanka Jain <priyanka.jain@nxp.com>
Cc: Simon Glass <sjg@chromium.org>
Cc: Heiko Schocher <hs@denx.de>
Cc: Patrick Delaunay <patrick.delaunay@st.com>
drivers/mtd/spi/sf_internal.h
drivers/mtd/spi/sf_mtd.c
drivers/mtd/spi/sf_probe.c