lkml.org 
[lkml]   [2022]   [Jun]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v2 12/19] iio: adc: at91-sama5d2_adc: move oversampling storage in its function
Date
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>
---
drivers/iio/adc/at91-sama5d2_adc.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index 254c084f7198..57c78cd23634 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -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;
}

@@ -1702,8 +1704,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;
--
2.34.1
\
 
 \ /
  Last update: 2022-06-28 17:17    [W:0.119 / U:0.212 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site