Re: [PATCH v7 3/5] i2c: davinci: calculate bus freq from Hz instead of kHz
From: Marcus Folkesson
Date: Mon Mar 09 2026 - 07:19:13 EST
Hi Andy,
On Mon, Feb 23, 2026 at 04:59:49PM +0200, Andy Shevchenko wrote:
> On Mon, Feb 23, 2026 at 03:33:52PM +0100, Marcus Folkesson wrote:
> > The bus frequency is unnecessarily converted between Hz and kHz in
> > several places.
> > This is probably an old legacy from the old times (pre-devicetrees)
> > when the davinci_i2c_platform_data took the bus_freq in kHz.
> >
> > Stick to Hz.
>
> ...
>
> > - clk = ((input_clock / (psc + 1)) / (dev->bus_freq * 1000));
> > + clk = ((input_clock / (psc + 1)) / (dev->bus_freq_hz));
>
> Two pairs too many parentheses!
>
> clk = (input_clock / (psc + 1)) / dev->bus_freq_hz;
>
> ...
>
> > + dev_dbg(dev->dev, "bus_freq_hz = %dHz\n", dev->bus_freq_hz);
>
> %u ?
Thank you for your comments, both this and the other.
This driver has a a few other style & formatting issues, would you prefer
to fix those in a separate patch in this patchset or in a following one?
>
> --
> With Best Regards,
> Andy Shevchenko
>
>
Thanks,
Marcus Folkesson
Attachment:
signature.asc
Description: PGP signature