[PATCH 2/5] ARM: mxs-lradc: Simplify mxs_lradc_trigger_init error handle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



As we have a 'ret' variable with the iio_trigger_register return, this
can be used as result.

Signed-off-by: Otavio Salvador <otavio@xxxxxxxxxxxxxxxx>
---
 drivers/staging/iio/adc/mxs-lradc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/iio/adc/mxs-lradc.c b/drivers/staging/iio/adc/mxs-lradc.c
index d92c97a..6d41846 100644
--- a/drivers/staging/iio/adc/mxs-lradc.c
+++ b/drivers/staging/iio/adc/mxs-lradc.c
@@ -671,14 +671,12 @@ static int mxs_lradc_trigger_init(struct iio_dev *iio)
 	trig->ops = &mxs_lradc_trigger_ops;
 
 	ret = iio_trigger_register(trig);
-	if (ret) {
+	if (ret)
 		iio_trigger_free(trig);
-		return ret;
-	}
 
 	iio->trig = trig;
 
-	return 0;
+	return ret;
 }
 
 static void mxs_lradc_trigger_remove(struct iio_dev *iio)
-- 
1.8.3.2

--
To unsubscribe from this list: send the line "unsubscribe linux-iio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Input]     [Linux Kernel]     [Linux SCSI]     [X.org]

  Powered by Linux