[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220609083213.1795019-9-claudiu.beznea@microchip.com>
Date: Thu, 9 Jun 2022 11:32:05 +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>, <robh+dt@...nel.org>,
<krzk+dt@...nel.org>, <ludovic.desroches@...el.com>
CC: <linux-iio@...r.kernel.org>,
<linux-arm-kernel@...ts.infradead.org>,
<devicetree@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
Claudiu Beznea <claudiu.beznea@...rochip.com>
Subject: [PATCH 08/16] 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 | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/iio/adc/at91-sama5d2_adc.c b/drivers/iio/adc/at91-sama5d2_adc.c
index fbb98e216e70..76367cc948e8 100644
--- a/drivers/iio/adc/at91-sama5d2_adc.c
+++ b/drivers/iio/adc/at91-sama5d2_adc.c
@@ -796,6 +796,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;
}
@@ -1695,9 +1697,6 @@ static int at91_adc_write_raw(struct iio_dev *indio_dev,
goto unlock;
/* update ratio */
ret = at91_adc_config_emr(st, val);
- if (ret)
- goto unlock;
- st->oversampling_ratio = val;
unlock:
mutex_unlock(&st->lock);
return ret;
--
2.34.1
Powered by blists - more mailing lists