Re: [PATCH] iio: frequency: ad983x: replace do_div() with div64_ul().

From: Joshua Crofts

Date: Fri Apr 10 2026 - 02:58:45 EST


On Fri, 10 Apr 2026 at 06:30, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxx> wrote:
> > The clk struct in linux/clk.h explicitly uses an unsigned long to represent
> > the clock value, which is used in this driver. Using an unsigned long
> > ensures platform independent usage without type mismatching.
>
> ...which effectively means the frequency most likely fits 32-bit. Otherwise
> would it ever work on 32-bit platform? This is a mistake in CLK design.

So we keep the do_div() macro and cast mclk to u32.

--
Kind regards

CJD