From f03e3f0b8b2275733d5e299efedaecce42b3db31 Mon Sep 17 00:00:00 2001 From: Jim Liu Date: Tue, 26 Dec 2023 10:00:06 +0800 Subject: [PATCH] spi: npcm_pspi: Fix the wrong clock divider calculation Fix the wrong clock divider calculation. Signed-off-by: Jim Liu --- drivers/spi/npcm_pspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/spi/npcm_pspi.c b/drivers/spi/npcm_pspi.c index 37bab70967..eb14185273 100644 --- a/drivers/spi/npcm_pspi.c +++ b/drivers/spi/npcm_pspi.c @@ -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; -- 2.39.5