diff options
Diffstat (limited to 'drivers/iio/adc/ad7766.c')
-rw-r--r-- | drivers/iio/adc/ad7766.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/iio/adc/ad7766.c b/drivers/iio/adc/ad7766.c index 1e41759f3ee5..51ee9482e0df 100644 --- a/drivers/iio/adc/ad7766.c +++ b/drivers/iio/adc/ad7766.c @@ -248,7 +248,8 @@ static int ad7766_probe(struct spi_device *spi) if (spi->irq > 0) { ad7766->trig = devm_iio_trigger_alloc(&spi->dev, "%s-dev%d", - indio_dev->name, indio_dev->id); + indio_dev->name, + iio_device_id(indio_dev)); if (!ad7766->trig) return -ENOMEM; @@ -272,8 +273,6 @@ static int ad7766_probe(struct spi_device *spi) return ret; } - spi_set_drvdata(spi, indio_dev); - ad7766->spi = spi; /* First byte always 0 */ @@ -289,10 +288,7 @@ static int ad7766_probe(struct spi_device *spi) if (ret) return ret; - ret = devm_iio_device_register(&spi->dev, indio_dev); - if (ret) - return ret; - return 0; + return devm_iio_device_register(&spi->dev, indio_dev); } static const struct spi_device_id ad7766_id[] = { |