Commit 4b135fe9 authored by Logiase Song's avatar Logiase Song Committed by Carles Cufi
Browse files

drivers: clock_control: stm32: fix error pll freq calculation



The origin pll freq calculation leads to an uint32_t overflow

Signed-off-by: default avatarLogiase Song <logiase.syx@gmail.com>
parent 44628735
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -73,8 +73,7 @@ static uint32_t get_pll_div_frequency(uint32_t pllsrc_freq,
{
	__ASSERT_NO_MSG(pllm_div && pllout_div);

	return (pllsrc_freq * plln_mul) /
		(pllm_div * pllout_div);
	return pllsrc_freq / pllm_div * plln_mul / pllout_div;
}

static uint32_t get_bus_clock(uint32_t clock, uint32_t prescaler)