iio: adc: at91-sama5d2_adc: move oversampling storage in its function
Move the storage of oversampling_ratio in at91_adc_config_emr(). This prepares for the next commits. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Link: https://lore.kernel.org/r/20220803102855.2191070-13-claudiu.beznea@microchip.com Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
This commit is contained in:
parent
5fc30713ac
commit
426b64752c
@ -793,6 +793,8 @@ static int at91_adc_config_emr(struct at91_adc_state *st,
|
||||
|
||||
at91_adc_writel(st, EMR, emr);
|
||||
|
||||
st->oversampling_ratio = oversampling_ratio;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -1705,8 +1707,6 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev,
|
||||
mutex_lock(&st->lock);
|
||||
/* update ratio */
|
||||
ret = at91_adc_config_emr(st, val);
|
||||
if (!ret)
|
||||
st->oversampling_ratio = val;
|
||||
mutex_unlock(&st->lock);
|
||||
iio_device_release_direct_mode(indio_dev);
|
||||
return ret;
|
||||
|
Loading…
x
Reference in New Issue
Block a user