ASoC: fsl_sai: use DIV_ROUND_CLOSEST() to calculate divider

In fsl_sai_set_bclk() we want to calculate the divider that gets us
closest to the desired frequency, so use DIV_ROUND_CLOSEST() instead of
just doing a clk_rate/freq.
Also discard invalid ratios earlier.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.kernel.org/r/20220302083428.3804687-7-s.hauer@pengutronix.de
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Sascha Hauer 2022-03-02 09:34:27 +01:00 • committed by Mark Brown
commit 1d4cbdf7bf
No known key found for this signature in database
GPG key ID: 24D68B725D5487D0