mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user