Commit f636d921 authored by Miquel Raynal's avatar Miquel Raynal
Browse files

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: default avatarMiquel Raynal <miquel.raynal@bootlin.com>
parent 0a331a18
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -53,6 +53,8 @@ static SPINAND_OP_VARIANTS(macronix_ops,
static struct spi_mem_op
spinand_fill_macronix_read_eccsr_op(struct spinand_device *spinand, void *valptr)
{
	WARN_ON_ONCE(spinand->bus_iface != SSDR);

	return (struct spi_mem_op)SPINAND_MACRONIX_READ_ECCSR_1S_0_1S(valptr);
}

+2 −0
Original line number Diff line number Diff line
@@ -114,6 +114,8 @@ static SPINAND_OP_VARIANTS(winbond_w25_ops,
static struct spi_mem_op
spinand_fill_winbond_select_target_op(struct spinand_device *spinand, void *valptr)
{
	WARN_ON_ONCE(spinand->bus_iface != SSDR);

	return (struct spi_mem_op)SPINAND_WINBOND_SELECT_TARGET_1S_0_1S(valptr);
}