spi: npcm_pspi: Fix the wrong clock divider calculation

Fix the wrong clock divider calculation.

Signed-off-by: Jim Liu <JJLIU0@nuvoton.com>
This commit is contained in:
Jim Liu
2023-12-26 10:00:06 +08:00
committed by Tom Rini
parent 2c9ee3f226
commit f03e3f0b8b

View File

@@ -144,7 +144,7 @@ static int npcm_pspi_set_speed(struct udevice *bus, uint speed)
if (speed > priv->max_hz)
speed = priv->max_hz;
divisor = DIV_ROUND_CLOSEST(apb_clock, (2 * speed) - 1);
divisor = DIV_ROUND_CLOSEST(apb_clock, (2 * speed)) - 1;
if (divisor > MAX_DIV)
divisor = MAX_DIV;