diff options
Diffstat (limited to 'drivers/staging/iio/dac/ad5791.c')
-rw-r--r-- | drivers/staging/iio/dac/ad5791.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/staging/iio/dac/ad5791.c b/drivers/staging/iio/dac/ad5791.c index 8b1b1b5..fbf446d 100644 --- a/drivers/staging/iio/dac/ad5791.c +++ b/drivers/staging/iio/dac/ad5791.c @@ -370,6 +370,7 @@ static int __devexit ad5791_remove(struct spi_device *spi) struct iio_dev *indio_dev = spi_get_drvdata(spi); struct ad5791_state *st = iio_priv(indio_dev); + iio_device_unregister(indio_dev); if (!IS_ERR(st->reg_vdd)) { regulator_disable(st->reg_vdd); regulator_put(st->reg_vdd); @@ -379,9 +380,7 @@ static int __devexit ad5791_remove(struct spi_device *spi) regulator_disable(st->reg_vss); regulator_put(st->reg_vss); } - iio_device_unregister(indio_dev); - - iio_device_unregister(indio_dev); + iio_free_device(indio_dev); return 0; } |