diff mbox series

[2/5] spi: Limit spi_set_wordlen to SPI_DEFAULT_WORDLEN

Message ID 20240614-mipi_dbi-v1-2-946eb82f8533@jookia.org
State Under Review
Delegated to: Anatolij Gustschin
Headers show
Series video: add support for MIPI DBI interface | expand

Commit Message

John Watts June 14, 2024, 12:18 p.m. UTC
We have no way to tell if we can actually set the wordlen in non-DM
code, so limit it to the default wordlen already in use.

Signed-off-by: John Watts <contact@jookia.org>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3649c9c25b..7be9bf9b17 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -12,7 +12,7 @@  int spi_set_wordlen(struct spi_slave *slave, unsigned int wordlen)
 {
 	int oldwordlen = slave->wordlen;
 
-	if (wordlen == 0 || wordlen > 32) {
+	if (wordlen != SPI_DEFAULT_WORDLEN) {
 		printf("spi: invalid wordlen %u\n", wordlen);
 		return -1;
 	}