public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes
@ 2024-11-11 11:36 Tudor Ambarus
  2024-11-25 13:57 ` Pratyush Yadav
  2024-12-06 15:51 ` Pratyush Yadav
  0 siblings, 2 replies; 3+ messages in thread
From: Tudor Ambarus @ 2024-11-11 11:36 UTC (permalink / raw)
  To: alvinzhou.tw
  Cc: mwalle, pratyush, linux-mtd, linux-kernel, chengminglin, leoyu,
	Tudor Ambarus

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(-)

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes
  2024-11-11 11:36 [PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes Tudor Ambarus
@ 2024-11-25 13:57 ` Pratyush Yadav
  2024-12-06 15:51 ` Pratyush Yadav
  1 sibling, 0 replies; 3+ messages in thread
From: Pratyush Yadav @ 2024-11-25 13:57 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: alvinzhou.tw, mwalle, pratyush, linux-mtd, linux-kernel,
	chengminglin, leoyu

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>

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes
  2024-11-11 11:36 [PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes Tudor Ambarus
  2024-11-25 13:57 ` Pratyush Yadav
@ 2024-12-06 15:51 ` Pratyush Yadav
  1 sibling, 0 replies; 3+ messages in thread
From: Pratyush Yadav @ 2024-12-06 15:51 UTC (permalink / raw)
  To: Tudor Ambarus
  Cc: alvinzhou.tw, mwalle, pratyush, linux-mtd, linux-kernel,
	chengminglin, leoyu

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.

-- 
Regards,
Pratyush Yadav

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-12-06 15:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-11 11:36 [PATCH] mtd: spi-nor: macronix: use nor->addr_nbytes Tudor Ambarus
2024-11-25 13:57 ` Pratyush Yadav
2024-12-06 15:51 ` Pratyush Yadav

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox