[PATCH 2/5] iio: adc: ad7606: remove redundant else after return

Antoniu Miclaus posted 5 patches 1 month, 2 weeks ago
[PATCH 2/5] iio: adc: ad7606: remove redundant else after return
Posted by Antoniu Miclaus 1 month, 2 weeks ago
The else performing the register write in ad7606_reg_access() is
unnecessary since the if block for the register read already returns.

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

diff --git a/drivers/iio/adc/ad7606.c b/drivers/iio/adc/ad7606.c
index d9271894f091..8ef3f7b8a6a4 100644
--- a/drivers/iio/adc/ad7606.c
+++ b/drivers/iio/adc/ad7606.c
@@ -540,9 +540,9 @@ static int ad7606_reg_access(struct iio_dev *indio_dev,
 			return ret;
 		*readval = ret;
 		return 0;
-	} else {
-		return st->bops->reg_write(st, reg, writeval);
 	}
+
+	return st->bops->reg_write(st, reg, writeval);
 }
 
 static int ad7606_pwm_set_high(struct ad7606_state *st)
-- 
2.43.0