linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: varkabhadram@gmail.com
To: linux-iio@vger.kernel.org
Cc: jic23@kernel.org, Varka Bhadram <varkab@cdac.in>
Subject: [PATCH iio 3/3] imu: inv_mpu6050: cleanup on error check
Date: Wed, 21 Jan 2015 11:29:37 +0530	[thread overview]
Message-ID: <1421819977-32232-3-git-send-email-varkabhadram@gmail.com> (raw)
In-Reply-To: <1421819977-32232-1-git-send-email-varkabhadram@gmail.com>

From: Varka Bhadram <varkab@cdac.in>


Signed-off-by: Varka Bhadram <varkab@cdac.in>
---
 drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
index ab8c85a..844610c 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
@@ -120,29 +120,28 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
 					  "%s-dev%d",
 					  indio_dev->name,
 					  indio_dev->id);
-	if (st->trig == NULL) {
-		ret = -ENOMEM;
-		goto error_ret;
-	}
+	if (!st->trig)
+		return -ENOMEM;
+
 	ret = devm_request_irq(&indio_dev->dev, st->client->irq,
 			       &iio_trigger_generic_data_rdy_poll,
 			       IRQF_TRIGGER_RISING,
 			       "inv_mpu",
 			       st->trig);
 	if (ret)
-		goto error_ret;
+		return ret;
+
 	st->trig->dev.parent = &st->client->dev;
 	st->trig->ops = &inv_mpu_trigger_ops;
 	iio_trigger_set_drvdata(st->trig, indio_dev);
+
 	ret = iio_trigger_register(st->trig);
 	if (ret)
-		goto error_ret;
+		return ret;
+
 	indio_dev->trig = iio_trigger_get(st->trig);
 
 	return 0;
-
-error_ret:
-	return ret;
 }
 
 void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st)
-- 
1.7.9.5


  parent reply	other threads:[~2015-01-21  6:04 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-21  5:59 [PATCH iio 1/3] imu: inv_mpu6050: use devm_request_irq varkabhadram
2015-01-21  5:59 ` [PATCH iio 2/3] imu: inv_mpu6050: use devm_iio_trigger_alloc varkabhadram
2015-01-21  5:59 ` varkabhadram [this message]
2015-01-21 10:19 ` [PATCH iio 1/3] imu: inv_mpu6050: use devm_request_irq Lars-Peter Clausen
2015-01-21 11:14   ` Varka Bhadram
2015-01-21 17:25     ` Jonathan Cameron
2015-01-22  3:09       ` Varka Bhadram

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1421819977-32232-3-git-send-email-varkabhadram@gmail.com \
    --to=varkabhadram@gmail.com \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=varkab@cdac.in \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).