diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-10-14 13:46:58 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-17 22:34:53 (GMT) |
commit | d2fffd6c2fd60fe9ab63ef30758d9d43a5057549 (patch) | |
tree | 7c0178872f67c15707cd3c89f82352ba90da1d09 /drivers/staging/iio/adc/ad7793.c | |
parent | cdea0bec8d37f2943ae500512b0c178bc76de6e3 (diff) | |
download | linux-fsl-qoriq-d2fffd6c2fd60fe9ab63ef30758d9d43a5057549.tar.xz |
staging:iio: fix removal path to allow correct freeing.
Fix a dumb lack of consideration of the effect of combining
the iio_device_unregister and iio_free_device calls into
one. There is no valid place to free some of the sysfs
array elements.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/adc/ad7793.c')
-rw-r--r-- | drivers/staging/iio/adc/ad7793.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/ad7793.c b/drivers/staging/iio/adc/ad7793.c index 0a536c5..a831b92 100644 --- a/drivers/staging/iio/adc/ad7793.c +++ b/drivers/staging/iio/adc/ad7793.c @@ -1013,6 +1013,7 @@ static int ad7793_remove(struct spi_device *spi) struct iio_dev *indio_dev = spi_get_drvdata(spi); struct ad7793_state *st = iio_priv(indio_dev); + iio_device_unregister(indio_dev); iio_buffer_unregister(indio_dev); ad7793_remove_trigger(indio_dev); ad7793_ring_cleanup(indio_dev); @@ -1022,7 +1023,7 @@ static int ad7793_remove(struct spi_device *spi) regulator_put(st->reg); } - iio_device_unregister(indio_dev); + iio_free_device(indio_dev); return 0; } |