Skip to content
Commit db10e201 authored by Josh Wu's avatar Josh Wu Committed by Jonathan Cameron
Browse files

iio: at91: fix adc_clk overflow



The adc_clk variable is currently defined using a 32-bits unsigned integer,
which will overflow under some very valid range of operations.

Such overflow will occur if, for example, the parent clock is set to a
20MHz frequency and the ADC startup time is larger than 215ns.

To fix this, introduce an intermediate variable holding the clock rate
in kHz.

Signed-off-by: default avatarJosh Wu <josh.wu@atmel.com>
Acked-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent c3cb718a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment