Skip to content

Commit 5be9a36

Browse files
ambarusPratyush Yadav
authored andcommitted
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 <[email protected]> Acked-by: Pratyush Yadav <[email protected]> Signed-off-by: Pratyush Yadav <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 792caa4 commit 5be9a36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/mtd/spi-nor/macronix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ static int macronix_nor_octal_dtr_en(struct spi_nor *nor)
230230
return ret;
231231

232232
/* Read flash ID to make sure the switch was successful. */
233-
ret = spi_nor_read_id(nor, 4, 4, buf, SNOR_PROTO_8_8_8_DTR);
233+
ret = spi_nor_read_id(nor, nor->addr_nbytes, 4, buf,
234+
SNOR_PROTO_8_8_8_DTR);
234235
if (ret) {
235236
dev_dbg(nor->dev, "error %d reading JEDEC ID after enabling 8D-8D-8D mode\n", ret);
236237
return ret;

0 commit comments

Comments
 (0)