mtd: spi-nor: macronix: use nor->addr_nbytes

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@linaro.org>
Acked-by: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Link: https://lore.kernel.org/r/20241111113609.12093-1-tudor.ambarus@linaro.org
This commit is contained in:
Tudor Ambarus
2024-11-11 13:36:09 +02:00
committed by Pratyush Yadav
parent 792caa4a4b
commit 5be9a36c44

View File

@@ -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;