summaryrefslogtreecommitdiff
path: root/drivers/staging/iio/gyro/adis16260_core.c
diff options
context:
space:
mode:
authorJonathan Cameron <jic23@cam.ac.uk>2011-10-14 14:46:58 +0100
committerGreg Kroah-Hartman <gregkh@suse.de>2011-10-17 15:34:53 -0700
commitd2fffd6c2fd60fe9ab63ef30758d9d43a5057549 (patch)
tree7c0178872f67c15707cd3c89f82352ba90da1d09 /drivers/staging/iio/gyro/adis16260_core.c
parentcdea0bec8d37f2943ae500512b0c178bc76de6e3 (diff)
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/gyro/adis16260_core.c')
-rw-r--r--drivers/staging/iio/gyro/adis16260_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/iio/gyro/adis16260_core.c b/drivers/staging/iio/gyro/adis16260_core.c
index ccbf2262c4c7..aaa3967f8c03 100644
--- a/drivers/staging/iio/gyro/adis16260_core.c
+++ b/drivers/staging/iio/gyro/adis16260_core.c
@@ -672,6 +672,8 @@ static int adis16260_remove(struct spi_device *spi)
int ret;
struct iio_dev *indio_dev = spi_get_drvdata(spi);
+ iio_device_unregister(indio_dev);
+
ret = adis16260_stop_device(indio_dev);
if (ret)
goto err_ret;
@@ -681,7 +683,7 @@ static int adis16260_remove(struct spi_device *spi)
adis16260_remove_trigger(indio_dev);
iio_buffer_unregister(indio_dev);
adis16260_unconfigure_ring(indio_dev);
- iio_device_unregister(indio_dev);
+ iio_free_device(indio_dev);
err_ret:
return ret;