diff options
author | Varka Bhadram <varkabhadram@gmail.com> | 2015-01-22 09:08:04 +0530 |
---|---|---|
committer | Jonathan Cameron <jic23@kernel.org> | 2015-01-27 18:49:58 +0000 |
commit | 76cd2e71780b5b5dfd6d0cffef8301b664d4fcf0 (patch) | |
tree | e29c24dc6eef0d4197278da3cd91e45b194690fa /drivers/iio/imu | |
parent | eec06b8c532588fb114fcbd9724f3c9fbdfe10c9 (diff) | |
download | linux-76cd2e71780b5b5dfd6d0cffef8301b664d4fcf0.tar.gz linux-76cd2e71780b5b5dfd6d0cffef8301b664d4fcf0.tar.bz2 linux-76cd2e71780b5b5dfd6d0cffef8301b664d4fcf0.zip |
imu: inv_mpu6050: cleanup on error check
Signed-off-by: Varka Bhadram <varkab@cdac.in>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio/imu')
-rw-r--r-- | drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 17 |
1 files 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 ab8c85a2a5f8..844610c3a3a9 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) |