summaryrefslogtreecommitdiffstats
path: root/drivers/iio
diff options
context:
space:
mode:
authorVarka Bhadram <varkabhadram@gmail.com>2015-01-22 09:08:02 +0530
committerJonathan Cameron <jic23@kernel.org>2015-01-27 18:49:57 +0000
commitb3e9ad703bef139fbcbb6423f4bafe3f89c97b00 (patch)
treeb3b0d86d8ee50b52ddf048c36bbb28d191838996 /drivers/iio
parentd5b97f5c7dfcad98927fb4f3b2e99d4c3beeec9a (diff)
downloadtalos-obmc-linux-b3e9ad703bef139fbcbb6423f4bafe3f89c97b00.tar.gz
talos-obmc-linux-b3e9ad703bef139fbcbb6423f4bafe3f89c97b00.zip
imu: inv_mpu6050: use devm_iio_trigger_alloc
Signed-off-by: Varka Bhadram <varkab@cdac.in> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
index 926fccea8de0..c827d21f7381 100644
--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
+++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
@@ -116,9 +116,10 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
int ret;
struct inv_mpu6050_state *st = iio_priv(indio_dev);
- st->trig = iio_trigger_alloc("%s-dev%d",
- indio_dev->name,
- indio_dev->id);
+ st->trig = devm_iio_trigger_alloc(&indio_dev->dev,
+ "%s-dev%d",
+ indio_dev->name,
+ indio_dev->id);
if (st->trig == NULL) {
ret = -ENOMEM;
goto error_ret;
@@ -128,7 +129,7 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
"inv_mpu",
st->trig);
if (ret)
- goto error_free_trig;
+ goto error_ret;
st->trig->dev.parent = &st->client->dev;
st->trig->ops = &inv_mpu_trigger_ops;
iio_trigger_set_drvdata(st->trig, indio_dev);
@@ -141,8 +142,6 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
error_free_irq:
free_irq(st->client->irq, st->trig);
-error_free_trig:
- iio_trigger_free(st->trig);
error_ret:
return ret;
}
@@ -151,5 +150,4 @@ void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st)
{
iio_trigger_unregister(st->trig);
free_irq(st->client->irq, st->trig);
- iio_trigger_free(st->trig);
}
OpenPOWER on IntegriCloud