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>
This commit is contained in:
Sai Santhosh Malae 2025-06-13 18:46:11 +05:30 committed by Henrik Brix Andersen
commit 4bf1c9e8f5

View file

@ -90,7 +90,8 @@ static int gspi_siwx91x_config(const struct device *dev, const struct spi_config
return -ENOTSUP;
}
if (SPI_WORD_SIZE_GET(spi_cfg->operation) > 16) {
if (SPI_WORD_SIZE_GET(spi_cfg->operation) != 8 &&
SPI_WORD_SIZE_GET(spi_cfg->operation) != 16) {
LOG_ERR("Word size incorrect %d!", SPI_WORD_SIZE_GET(spi_cfg->operation));
return -ENOTSUP;
}