diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-10-14 14:46:58 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-10-17 15:34:53 -0700 |
commit | d2fffd6c2fd60fe9ab63ef30758d9d43a5057549 (patch) | |
tree | 7c0178872f67c15707cd3c89f82352ba90da1d09 /drivers/staging/iio/light/tsl2563.c | |
parent | cdea0bec8d37f2943ae500512b0c178bc76de6e3 (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/light/tsl2563.c')
-rw-r--r-- | drivers/staging/iio/light/tsl2563.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/staging/iio/light/tsl2563.c b/drivers/staging/iio/light/tsl2563.c index a5e08b32e42c..7e984bcf8d7e 100644 --- a/drivers/staging/iio/light/tsl2563.c +++ b/drivers/staging/iio/light/tsl2563.c @@ -789,6 +789,8 @@ static int tsl2563_remove(struct i2c_client *client) { struct tsl2563_chip *chip = i2c_get_clientdata(client); struct iio_dev *indio_dev = iio_priv_to_dev(chip); + + iio_device_unregister(indio_dev); if (!chip->int_enabled) cancel_delayed_work(&chip->poweroff_work); /* Ensure that interrupts are disabled - then flush any bottom halves */ @@ -799,7 +801,8 @@ static int tsl2563_remove(struct i2c_client *client) tsl2563_set_power(chip, 0); if (client->irq) free_irq(client->irq, indio_dev); - iio_device_unregister(indio_dev); + + iio_free_device(indio_dev); return 0; } |