Skip to content

Commit f636d92

Browse files
committed
mtd: spinand: Warn if using SSDR-only vendor commands in a non SSDR mode
Both Macronix and Winbond have chip specific operations which are SSDR only. Trying to use them in an ODTR setup will fail and doing this is a pure software bug. Warn explicitly in this case. Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
1 parent 0a331a1 commit f636d92

2 files changed

Lines changed: 4 additions & 0 deletions

File tree

drivers/mtd/nand/spi/macronix.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ static SPINAND_OP_VARIANTS(macronix_ops,
5353
static struct spi_mem_op
5454
spinand_fill_macronix_read_eccsr_op(struct spinand_device *spinand, void *valptr)
5555
{
56+
WARN_ON_ONCE(spinand->bus_iface != SSDR);
57+
5658
return (struct spi_mem_op)SPINAND_MACRONIX_READ_ECCSR_1S_0_1S(valptr);
5759
}
5860

drivers/mtd/nand/spi/winbond.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ static SPINAND_OP_VARIANTS(winbond_w25_ops,
114114
static struct spi_mem_op
115115
spinand_fill_winbond_select_target_op(struct spinand_device *spinand, void *valptr)
116116
{
117+
WARN_ON_ONCE(spinand->bus_iface != SSDR);
118+
117119
return (struct spi_mem_op)SPINAND_WINBOND_SELECT_TARGET_1S_0_1S(valptr);
118120
}
119121

0 commit comments

Comments
 (0)