diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-08-30 12:41:18 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-09-06 16:00:29 -0700 |
commit | 3e39440789adef103422ce201538b4da8745fe8e (patch) | |
tree | 3cf742695f53ec91f0ff87ab3a9db513383c53ae /drivers/staging/iio/dac/ad5624r_spi.c | |
parent | acc131fa9f9d81b2a031ab1e7115856ba33e057d (diff) | |
download | op-kernel-dev-3e39440789adef103422ce201538b4da8745fe8e.zip op-kernel-dev-3e39440789adef103422ce201538b4da8745fe8e.tar.gz |
staging:iio:fix using iio_priv or iio_dev after iio_unregister_device
This includes calling iio_free_device as that should only be called
before the device has been registered.
Also one case of iio_free_device being called on a registered device.
This has been pulled out of the reworking attributes patch.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/dac/ad5624r_spi.c')
-rw-r--r-- | drivers/staging/iio/dac/ad5624r_spi.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/iio/dac/ad5624r_spi.c b/drivers/staging/iio/dac/ad5624r_spi.c index 7303bb1..c4bdf42 100644 --- a/drivers/staging/iio/dac/ad5624r_spi.c +++ b/drivers/staging/iio/dac/ad5624r_spi.c @@ -262,12 +262,12 @@ static int __devinit ad5624r_probe(struct spi_device *spi) indio_dev->info = &ad5624r_info; indio_dev->modes = INDIO_DIRECT_MODE; - ret = iio_device_register(indio_dev); + ret = ad5624r_spi_write(spi, AD5624R_CMD_INTERNAL_REFER_SETUP, 0, + !!voltage_uv, 16); if (ret) goto error_free_dev; - ret = ad5624r_spi_write(spi, AD5624R_CMD_INTERNAL_REFER_SETUP, 0, - !!voltage_uv, 16); + ret = iio_device_register(indio_dev); if (ret) goto error_free_dev; |