[PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes
Tudor Ambarus
tudor.ambarus at linaro.org
Mon Nov 11 03:36:09 PST 2024
Use the nor->addr_nbytes set by the core, we shouldn't use
magic numbers or states that are not tracked by the core.
Signed-off-by: Tudor Ambarus <tudor.ambarus at linaro.org>
---
Alvin claimed he tested this patch at:
https://lore.kernel.org/linux-mtd/CAPhrvRQrugRQgQcdHBdwid3_sUkCm0mZL9zhz1=TYzXg4qUTfw@mail.gmail.com/
Though a Tested-by tag would be nice. Thanks!
drivers/mtd/spi-nor/macronix.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/spi-nor/macronix.c b/drivers/mtd/spi-nor/macronix.c
index 830da21eea08..57a40fa70c6a 100644
--- a/drivers/mtd/spi-nor/macronix.c
+++ b/drivers/mtd/spi-nor/macronix.c
@@ -230,7 +230,8 @@ static int macronix_nor_octal_dtr_en(struct spi_nor *nor)
return ret;
/* Read flash ID to make sure the switch was successful. */
- ret = spi_nor_read_id(nor, 4, 4, buf, SNOR_PROTO_8_8_8_DTR);
+ ret = spi_nor_read_id(nor, nor->addr_nbytes, 4, buf,
+ SNOR_PROTO_8_8_8_DTR);
if (ret) {
dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret);
return ret;
--
2.34.1
More information about the linux-mtd
mailing list