Commit 76cd2e71 authored by Varka Bhadram's avatar Varka Bhadram Committed by Jonathan Cameron

imu: inv_mpu6050: cleanup on error check

Signed-off-by: default avatarVarka Bhadram <varkab@cdac.in>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent eec06b8c
...@@ -120,29 +120,28 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev) ...@@ -120,29 +120,28 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
"%s-dev%d", "%s-dev%d",
indio_dev->name, indio_dev->name,
indio_dev->id); indio_dev->id);
if (st->trig == NULL) { if (!st->trig)
ret = -ENOMEM; return -ENOMEM;
goto error_ret;
}
ret = devm_request_irq(&indio_dev->dev, st->client->irq, ret = devm_request_irq(&indio_dev->dev, st->client->irq,
&iio_trigger_generic_data_rdy_poll, &iio_trigger_generic_data_rdy_poll,
IRQF_TRIGGER_RISING, IRQF_TRIGGER_RISING,
"inv_mpu", "inv_mpu",
st->trig); st->trig);
if (ret) if (ret)
goto error_ret; return ret;
st->trig->dev.parent = &st->client->dev; st->trig->dev.parent = &st->client->dev;
st->trig->ops = &inv_mpu_trigger_ops; st->trig->ops = &inv_mpu_trigger_ops;
iio_trigger_set_drvdata(st->trig, indio_dev); iio_trigger_set_drvdata(st->trig, indio_dev);
ret = iio_trigger_register(st->trig); ret = iio_trigger_register(st->trig);
if (ret) if (ret)
goto error_ret; return ret;
indio_dev->trig = iio_trigger_get(st->trig); indio_dev->trig = iio_trigger_get(st->trig);
return 0; return 0;
error_ret:
return ret;
} }
void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st) void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment