Commit c41d79b7 authored by Chuhong Yuan's avatar Chuhong Yuan Committed by Jonathan Cameron

iio: adc: max1027: fix not unregistered iio trigger

The driver forgets to unregister the iio trigger in probe failure and
remove.
Use devm API to fix it.
Signed-off-by: default avatarChuhong Yuan <hslester96@gmail.com>
Signed-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent 1f310f77
...@@ -478,7 +478,13 @@ static int max1027_probe(struct spi_device *spi) ...@@ -478,7 +478,13 @@ static int max1027_probe(struct spi_device *spi)
st->trig->ops = &max1027_trigger_ops; st->trig->ops = &max1027_trigger_ops;
st->trig->dev.parent = &spi->dev; st->trig->dev.parent = &spi->dev;
iio_trigger_set_drvdata(st->trig, indio_dev); iio_trigger_set_drvdata(st->trig, indio_dev);
iio_trigger_register(st->trig); ret = devm_iio_trigger_register(&indio_dev->dev,
st->trig);
if (ret < 0) {
dev_err(&indio_dev->dev,
"Failed to register iio trigger\n");
return ret;
}
ret = devm_request_threaded_irq(&spi->dev, spi->irq, ret = devm_request_threaded_irq(&spi->dev, spi->irq,
iio_trigger_generic_data_rdy_poll, iio_trigger_generic_data_rdy_poll,
......
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