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

Andy Shevchenko andriy.shevchenko at intel.com
Mon Feb 23 06:59:49 PST 2026


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 ?

-- 
With Best Regards,
Andy Shevchenko





More information about the linux-arm-kernel mailing list