#include <linux/spi/spi.h>
#include <linux/slab.h>
#include <linux/sysfs.h>
+#include <linux/module.h>
#include "../iio.h"
#include "../sysfs.h"
static const struct iio_chan_spec adis16060_channels[] = {
{
- .type = IIO_GYRO,
+ .type = IIO_ANGL_VEL,
.modified = 1,
.channel2 = IIO_MOD_Z,
.address = ADIS16060_GYRO,
}, {
- .type = IIO_IN,
+ .type = IIO_VOLTAGE,
.indexed = 1,
.channel = 0,
.address = ADIS16060_AIN1,
}, {
- .type = IIO_IN,
+ .type = IIO_VOLTAGE,
.indexed = 1,
.channel = 1,
.address = ADIS16060_AIN2,
static int __devinit adis16060_r_probe(struct spi_device *spi)
{
- int ret, regdone = 0;
+ int ret;
struct adis16060_state *st;
struct iio_dev *indio_dev;
ret = iio_device_register(indio_dev);
if (ret)
goto error_free_dev;
- regdone = 1;
adis16060_iio_dev = indio_dev;
return 0;
error_free_dev:
- if (regdone)
- iio_device_unregister(indio_dev);
- else
- iio_free_device(indio_dev);
+ iio_free_device(indio_dev);
error_ret:
return ret;
}
static int adis16060_r_remove(struct spi_device *spi)
{
iio_device_unregister(spi_get_drvdata(spi));
+ iio_free_device(spi_get_drvdata(spi));
return 0;
}