[PATCH v2 2/3] pwm: stm32: Fix calculation of prescaler
Uwe Kleine-König
u.kleine-koenig at baylibre.com
Sat Jun 22 07:07:49 PDT 2024
Hello,
[Dropping Benjamin Gaignard, his address doesn't work]
On Fri, Jun 21, 2024 at 04:37:13PM +0200, Uwe Kleine-König wrote:
> prescaler = mul_u64_u64_div_u64(period_ns, clk_get_rate(priv->clk),
> - (u64)NSEC_PER_SEC * priv->max_arr);
> - if (prescaler > 0)
> - prescaler -= 1;
> -
> + (u64)NSEC_PER_SEC * (priv->max_arr + 1));
priv->max_arr + 1 needs a cast to u64 as max_arr is an u32 that for some
hardware is 0xffffffff.
I fix that when applying.
Best regards
Uwe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20240622/b66344fd/attachment.sig>
More information about the linux-arm-kernel
mailing list