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 <cont...@jookia.org>
---
 drivers/spi/spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
        }

-- 
2.45.2

Reply via email to