[PATCH v7 3/5] i2c: davinci: calculate bus freq from Hz instead of kHz

Marcus Folkesson marcus.folkesson at gmail.com
Mon Mar 9 04:14:15 PDT 2026


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20260309/ffe0d580/attachment-0001.sig>


More information about the linux-arm-kernel mailing list