mpfs_corespi: Fix DEBUGASSERT() for clk divider

Valid range is 0...255, not 2...512
This commit is contained in:
Ville Juven 2023-06-01 14:33:58 +03:00 committed by Alan Carvalho de Assis
parent 4c9e11d559
commit 4d49f80e16

View File

@ -540,7 +540,7 @@ static uint32_t mpfs_spi_setfrequency(struct spi_dev_s *dev,
divider = ((MPFS_FPGA_PERIPHERAL_CLK / frequency) >> 1) - 1;
priv->actual = MPFS_FPGA_PERIPHERAL_CLK / ((divider + 1) << 1);
DEBUGASSERT(divider >= 2u && divider <= 512u);
DEBUGASSERT(divider < 256u);
putreg32(divider, MPFS_SPI_CLK_GEN);