[PATCH 1/5] iio: adc: ad7298: remove redundant else after return

Antoniu Miclaus posted 5 patches 1 month, 2 weeks ago
[PATCH 1/5] iio: adc: ad7298: remove redundant else after return
Posted by Antoniu Miclaus 1 month, 2 weeks ago
The else returning the internal reference voltage in
ad7298_get_ref_voltage() is unnecessary since the if block for the
external regulator already returns.

Signed-off-by: Antoniu Miclaus <antoniu.miclaus@analog.com>
---
 drivers/iio/adc/ad7298.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/iio/adc/ad7298.c b/drivers/iio/adc/ad7298.c
index 7c0538ea15c8..e775d84da333 100644
--- a/drivers/iio/adc/ad7298.c
+++ b/drivers/iio/adc/ad7298.c
@@ -216,9 +216,9 @@ static int ad7298_get_ref_voltage(struct ad7298_state *st)
 			return vref;
 
 		return vref / 1000;
-	} else {
-		return AD7298_INTREF_mV;
 	}
+
+	return AD7298_INTREF_mV;
 }
 
 static int ad7298_read_raw(struct iio_dev *indio_dev,
-- 
2.43.0