Skip to content

Commit 4bf1c9e

Browse files
smalaehenrikbrixandersen
authored andcommitted
drivers: spi: siwx91x: spi driver fix
Validate word size to only allow 8-bit and 16-bit. Signed-off-by: Sai Santhosh Malae <Santhosh.Malae@silabs.com>
1 parent 8aa6557 commit 4bf1c9e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

drivers/spi/spi_silabs_siwx91x_gspi.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,8 @@ static int gspi_siwx91x_config(const struct device *dev, const struct spi_config
9090
return -ENOTSUP;
9191
}
9292

93-
if (SPI_WORD_SIZE_GET(spi_cfg->operation) > 16) {
93+
if (SPI_WORD_SIZE_GET(spi_cfg->operation) != 8 &&
94+
SPI_WORD_SIZE_GET(spi_cfg->operation) != 16) {
9495
LOG_ERR("Word size incorrect %d!", SPI_WORD_SIZE_GET(spi_cfg->operation));
9596
return -ENOTSUP;
9697
}

0 commit comments

Comments
 (0)