aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/iio/adc/ad7780.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/adc/ad7780.c
parentiio: adc: remove ADT75 driver - hwmon/lm75 will take over ADT75 support (diff)
downloadlinux-dev-d2fffd6c2fd60fe9ab63ef30758d9d43a5057549.tar.xz
linux-dev-d2fffd6c2fd60fe9ab63ef30758d9d43a5057549.zip
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/ad7780.c')
-rw-r--r--drivers/staging/iio/adc/ad7780.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/iio/adc/ad7780.c b/drivers/staging/iio/adc/ad7780.c
index a8103c06e749..7a579a1fd696 100644
--- a/drivers/staging/iio/adc/ad7780.c
+++ b/drivers/staging/iio/adc/ad7780.c
@@ -255,13 +255,14 @@ static int ad7780_remove(struct spi_device *spi)
struct iio_dev *indio_dev = spi_get_drvdata(spi);
struct ad7780_state *st = iio_priv(indio_dev);
+ iio_device_unregister(indio_dev);
free_irq(spi->irq, st);
gpio_free(st->pdata->gpio_pdrst);
if (!IS_ERR(st->reg)) {
regulator_disable(st->reg);
regulator_put(st->reg);
}
- iio_device_unregister(indio_dev);
+ iio_free_device(indio_dev);
return 0;
}