[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220803102855.2191070-13-claudiu.beznea@microchip.com>
Date: Wed, 3 Aug 2022 13:28:48 +0300
From: Claudiu Beznea <claudiu.beznea@...rochip.com>
To: <eugen.hristev@...rochip.com>, <jic23@...nel.org>,
<lars@...afoo.de>, <nicolas.ferre@...rochip.com>,
<alexandre.belloni@...tlin.com>, <ludovic.desroches@...rochip.com>,
<robh+dt@...nel.org>
CC: <linux-iio@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<linux-kernel@...r.kernel.org>, <devicetree@...r.kernel.org>,
Claudiu Beznea <claudiu.beznea@...rochip.com>
Subject: [PATCH v3 12/19] 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@...rochip.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 d6a93aa7fbaf..a1df475a6f29 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;
}
@@ -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;
--
2.34.1
Powered by blists - more mailing lists