Commit eec06b8c authored by Varka Bhadram's avatar Varka Bhadram Committed by Jonathan Cameron

imu: inv_mpu6050: use devm_request_irq

This patch use the devres API for requesting an IRQ.
Signed-off-by: default avatarVarka Bhadram <varkab@cdac.in>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent b3e9ad70
......@@ -124,7 +124,8 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
ret = -ENOMEM;
goto error_ret;
}
ret = request_irq(st->client->irq, &iio_trigger_generic_data_rdy_poll,
ret = devm_request_irq(&indio_dev->dev, st->client->irq,
&iio_trigger_generic_data_rdy_poll,
IRQF_TRIGGER_RISING,
"inv_mpu",
st->trig);
......@@ -135,13 +136,11 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
iio_trigger_set_drvdata(st->trig, indio_dev);
ret = iio_trigger_register(st->trig);
if (ret)
goto error_free_irq;
goto error_ret;
indio_dev->trig = iio_trigger_get(st->trig);
return 0;
error_free_irq:
free_irq(st->client->irq, st->trig);
error_ret:
return ret;
}
......@@ -149,5 +148,4 @@ int inv_mpu6050_probe_trigger(struct iio_dev *indio_dev)
void inv_mpu6050_remove_trigger(struct inv_mpu6050_state *st)
{
iio_trigger_unregister(st->trig);
free_irq(st->client->irq, st->trig);
}
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