[PATCH v3 14/15] mtd: spi-nor: Drop deprecated mechanism for optional SFDP parsing

Esben Haabendal esben at geanix.com
Thu Jul 11 06:00:14 PDT 2024


With all drivers converted to the new SPI_NOR_TRY_SFDP flag, we can remove
the old deprecated mechanism for triggering optional SFDP parsing.

New flashes must use SPI_NOR_TRY_SFDP to get this behavior. Hopefully, all
new drivers will be fore pure SFDP flashes, so no or at least very few new
users of this flag is expected.

Signed-off-by: Esben Haabendal <esben at geanix.com>
---
 drivers/mtd/spi-nor/core.h | 19 +------------------
 1 file changed, 1 insertion(+), 18 deletions(-)

diff --git a/drivers/mtd/spi-nor/core.h b/drivers/mtd/spi-nor/core.h
index dfc81716e068..f4a76f42051a 100644
--- a/drivers/mtd/spi-nor/core.h
+++ b/drivers/mtd/spi-nor/core.h
@@ -719,24 +719,7 @@ static inline bool spi_nor_needs_sfdp(const struct spi_nor *nor)
  */
 static inline bool spi_nor_try_sfdp(const struct spi_nor *nor)
 {
-	if (nor->info->no_sfdp_flags & SPI_NOR_SKIP_SFDP)
-		return false;
-	if (nor->info->no_sfdp_flags & SPI_NOR_TRY_SFDP)
-		return true;
-
-	/* Deprecated/legacy way for triggering optional SFDP parsing.
-	 * If one of the no_sfdp_flags indicating dual, quad or octal read is
-	 * set, SFDP parsing will be tried.
-	 * When all drivers have been converted to set SPI_NOR_TRY_SFDP where
-	 * needed, this deprecated mechanism can be removed.
-	 */
-	if (nor->info->no_sfdp_flags & (SPI_NOR_DUAL_READ |
-					SPI_NOR_QUAD_READ |
-					SPI_NOR_OCTAL_READ |
-					SPI_NOR_OCTAL_DTR_READ))
-		return true;
-
-	return false;
+	return (nor->info->no_sfdp_flags & SPI_NOR_TRY_SFDP)
 }
 
 #ifdef CONFIG_DEBUG_FS

-- 
2.45.2




More information about the linux-mtd mailing list