Skip to content
Commit 6aadcb81 authored by Michael Walle's avatar Michael Walle Committed by Andre Przywara
Browse files

spi: sunxi: fix CDR2 calculation



The CDR2 divider calculation always yield a frequency greater than the
requested one. Use DIV_ROUND_UP() to keep the frequency equal or below
the requested one. This way, we can also drop the "if div > 0" check
because we know for a fact that div cannot be zero.

FWIW, this aligns the CDR2 calculation with the linux driver.

Suggested-by: default avatarAndre Przywara <andre.przywara@arm.com>
Signed-off-by: default avatarMichael Walle <mwalle@kernel.org>
Reviewed-by: default avatarAndre Przywara <andre.przywara@arm.com>
parent 895d0517
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment