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:
parent
8aa6557c95
commit
4bf1c9e8f5
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue