]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
mtd: spi-nor: Check nor->info before setting macronix_octal_fixups
authorTakahiro Kuwano <Takahiro.Kuwano@infineon.com>
Tue, 15 Oct 2024 04:08:33 +0000 (13:08 +0900)
committerTom Rini <trini@konsulko.com>
Tue, 15 Oct 2024 14:57:49 +0000 (08:57 -0600)
The macronix_octal_fixups should be set only when mfr and flags match.

Fixes: df3d5f9e41 ("mtd: spi-nor: add support for Macronix Octal flash")
Acked-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Takahiro Kuwano <Takahiro.Kuwano@infineon.com>
Cc: JaimeLiao <jaimeliao.tw@gmail.com>
drivers/mtd/spi/spi-nor-core.c

index d39d0ee7813db386f37a4ce7c3beb71068960014..466729cd2a7906db50a003cad6d56cd9323b5fcb 100644 (file)
@@ -4423,7 +4423,9 @@ void spi_nor_set_fixups(struct spi_nor *nor)
 #endif
 
 #if CONFIG_IS_ENABLED(SPI_FLASH_MACRONIX)
-       nor->fixups = &macronix_octal_fixups;
+       if (JEDEC_MFR(nor->info) == SNOR_MFR_MACRONIX &&
+           nor->info->flags & SPI_NOR_OCTAL_DTR_READ)
+               nor->fixups = &macronix_octal_fixups;
 #endif /* SPI_FLASH_MACRONIX */
 }