diff mbox series

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

Message ID 20241111113609.12093-1-tudor.ambarus@linaro.org
State Accepted
Headers show
Series mtd: spi-nor: macronix: use nor->addr_nbytes | expand

Commit Message

Tudor Ambarus Nov. 11, 2024, 11:36 a.m. UTC
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>
---
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(-)

Comments

Pratyush Yadav Nov. 25, 2024, 1:57 p.m. UTC | #1
On Mon, Nov 11 2024, Tudor Ambarus wrote:

> 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>
Pratyush Yadav Dec. 6, 2024, 3:51 p.m. UTC | #2
On Mon, Nov 11 2024, Tudor Ambarus wrote:

> 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>
> ---
> 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!

Well, we didn't get a Tested-by, but that is fine since we know it has
been tested by Alvin. Applied to spi-nor/next. Thanks!

BTW, b4 complains about DKIM signature when picking up your patch:

    BADSIG: DKIM/linaro.org

Maybe take a look at your settings or ask Linaro IT about it.
diff mbox series

Patch

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;