From: Jim Liu Date: Tue, 26 Dec 2023 02:00:06 +0000 (+0800) Subject: spi: npcm_pspi: Fix the wrong clock divider calculation X-Git-Url: http://git.dujemihanovic.xyz/img/static/git-logo.png?a=commitdiff_plain;h=f03e3f0b8b2275733d5e299efedaecce42b3db31;p=u-boot.git spi: npcm_pspi: Fix the wrong clock divider calculation Fix the wrong clock divider calculation. Signed-off-by: Jim Liu --- 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;