diff options
author | Jonathan Cameron <jic23@cam.ac.uk> | 2011-05-18 13:42:37 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-05-19 23:15:05 (GMT) |
commit | 6fe8135fccd66aedcc55ded70824342587fd2499 (patch) | |
tree | 3afc7acfd0edc052ba93241761e935af9a3b6ebc /drivers/staging/iio/dds | |
parent | a3f02370c9fa6d85fbee2c11649ebc9c84bae919 (diff) | |
download | linux-fsl-qoriq-6fe8135fccd66aedcc55ded70824342587fd2499.tar.xz |
staging:iio: implement an iio_info structure to take some of the constant elements out of iio_dev.
This was suggested by Arnd Bergmann, Other elements may well
move in here in future, but it definitely makes sense for these.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/iio/dds')
-rw-r--r-- | drivers/staging/iio/dds/ad5930.c | 12 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9832.c | 8 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9834.c | 8 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9850.c | 10 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9852.c | 10 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9910.c | 10 | ||||
-rw-r--r-- | drivers/staging/iio/dds/ad9951.c | 10 |
7 files changed, 43 insertions, 25 deletions
diff --git a/drivers/staging/iio/dds/ad5930.c b/drivers/staging/iio/dds/ad5930.c index 5d98f93..490c363 100644 --- a/drivers/staging/iio/dds/ad5930.c +++ b/drivers/staging/iio/dds/ad5930.c @@ -87,6 +87,12 @@ static const struct attribute_group ad5930_attribute_group = { .attrs = ad5930_attributes, }; +static const struct iio_info ad5930_info = { + .attrs = &ad5930_attribute_group, + + .driver_module = THIS_MODULE, +}; + static int __devinit ad5930_probe(struct spi_device *spi) { struct ad5930_state *st; @@ -108,12 +114,8 @@ static int __devinit ad5930_probe(struct spi_device *spi) goto error_free_st; } st->idev->dev.parent = &spi->dev; - st->idev->num_interrupt_lines = 0; - st->idev->event_attrs = NULL; - - st->idev->attrs = &ad5930_attribute_group; st->idev->dev_data = (void *)(st); - st->idev->driver_module = THIS_MODULE; + st->idev->info = &ad5930_info; st->idev->modes = INDIO_DIRECT_MODE; ret = iio_device_register(st->idev); diff --git a/drivers/staging/iio/dds/ad9832.c b/drivers/staging/iio/dds/ad9832.c index 4b5721c..e8fe142 100644 --- a/drivers/staging/iio/dds/ad9832.c +++ b/drivers/staging/iio/dds/ad9832.c @@ -195,6 +195,11 @@ static const struct attribute_group ad9832_attribute_group = { .attrs = ad9832_attributes, }; +static const struct iio_info ad9832_info = { + .attrs = &ad9832_attribute_group, + .driver_module = THIS_MODULE, +}; + static int __devinit ad9832_probe(struct spi_device *spi) { struct ad9832_platform_data *pdata = spi->dev.platform_data; @@ -232,9 +237,8 @@ static int __devinit ad9832_probe(struct spi_device *spi) st->indio_dev->dev.parent = &spi->dev; st->indio_dev->name = spi_get_device_id(spi)->name; - st->indio_dev->attrs = &ad9832_attribute_group; + st->indio_dev->info = &ad9832_info; st->indio_dev->dev_data = (void *) st; - st->indio_dev->driver_module = THIS_MODULE; st->indio_dev->modes = INDIO_DIRECT_MODE; /* Setup default messages */ diff --git a/drivers/staging/iio/dds/ad9834.c b/drivers/staging/iio/dds/ad9834.c index e5303e6..0ebe8d5 100644 --- a/drivers/staging/iio/dds/ad9834.c +++ b/drivers/staging/iio/dds/ad9834.c @@ -305,6 +305,11 @@ static const struct attribute_group ad9834_attribute_group = { .is_visible = ad9834_attr_is_visible, }; +static const struct iio_info ad9834_info = { + .attrs = &ad9834_attribute_group, + .driver_module = THIS_MODULE, +}; + static int __devinit ad9834_probe(struct spi_device *spi) { struct ad9834_platform_data *pdata = spi->dev.platform_data; @@ -344,9 +349,8 @@ static int __devinit ad9834_probe(struct spi_device *spi) st->indio_dev->dev.parent = &spi->dev; st->indio_dev->name = spi_get_device_id(spi)->name; - st->indio_dev->attrs = &ad9834_attribute_group; + st->indio_dev->info = &ad9834_info; st->indio_dev->dev_data = (void *) st; - st->indio_dev->driver_module = THIS_MODULE; st->indio_dev->modes = INDIO_DIRECT_MODE; /* Setup default messages */ diff --git a/drivers/staging/iio/dds/ad9850.c b/drivers/staging/iio/dds/ad9850.c index 34bc0e6..b580d85 100644 --- a/drivers/staging/iio/dds/ad9850.c +++ b/drivers/staging/iio/dds/ad9850.c @@ -73,6 +73,11 @@ static const struct attribute_group ad9850_attribute_group = { .attrs = ad9850_attributes, }; +static const struct iio_info ad9850_info = { + .attrs = &ad9850_attribute_group, + .driver_module = THIS_MODULE, +}; + static int __devinit ad9850_probe(struct spi_device *spi) { struct ad9850_state *st; @@ -94,12 +99,9 @@ static int __devinit ad9850_probe(struct spi_device *spi) goto error_free_st; } st->idev->dev.parent = &spi->dev; - st->idev->num_interrupt_lines = 0; - st->idev->event_attrs = NULL; - st->idev->attrs = &ad9850_attribute_group; + st->idev->info = &ad9850_info; st->idev->dev_data = (void *)(st); - st->idev->driver_module = THIS_MODULE; st->idev->modes = INDIO_DIRECT_MODE; ret = iio_device_register(st->idev); diff --git a/drivers/staging/iio/dds/ad9852.c b/drivers/staging/iio/dds/ad9852.c index 899a72a..08020f9 100644 --- a/drivers/staging/iio/dds/ad9852.c +++ b/drivers/staging/iio/dds/ad9852.c @@ -222,6 +222,11 @@ static const struct attribute_group ad9852_attribute_group = { .attrs = ad9852_attributes, }; +static const struct iio_info ad9852_info = { + .attrs = &ad9852_attribute_group, + .driver_module = THIS_MODULE, +}; + static int __devinit ad9852_probe(struct spi_device *spi) { struct ad9852_state *st; @@ -243,12 +248,9 @@ static int __devinit ad9852_probe(struct spi_device *spi) goto error_free_st; } st->idev->dev.parent = &spi->dev; - st->idev->num_interrupt_lines = 0; - st->idev->event_attrs = NULL; - st->idev->attrs = &ad9852_attribute_group; + st->idev->info = &ad9852_info; st->idev->dev_data = (void *)(st); - st->idev->driver_module = THIS_MODULE; st->idev->modes = INDIO_DIRECT_MODE; ret = iio_device_register(st->idev); diff --git a/drivers/staging/iio/dds/ad9910.c b/drivers/staging/iio/dds/ad9910.c index fddb6e7..97d75d7 100644 --- a/drivers/staging/iio/dds/ad9910.c +++ b/drivers/staging/iio/dds/ad9910.c @@ -357,6 +357,11 @@ static const struct attribute_group ad9910_attribute_group = { .attrs = ad9910_attributes, }; +static const struct iio_info ad9910_info = { + .attrs = &ad9910_attribute_group, + .driver_module = THIS_MODULE, +}; + static int __devinit ad9910_probe(struct spi_device *spi) { struct ad9910_state *st; @@ -378,12 +383,9 @@ static int __devinit ad9910_probe(struct spi_device *spi) goto error_free_st; } st->idev->dev.parent = &spi->dev; - st->idev->num_interrupt_lines = 0; - st->idev->event_attrs = NULL; - st->idev->attrs = &ad9910_attribute_group; + st->idev->info = &ad9910_info; st->idev->dev_data = (void *)(st); - st->idev->driver_module = THIS_MODULE; st->idev->modes = INDIO_DIRECT_MODE; ret = iio_device_register(st->idev); diff --git a/drivers/staging/iio/dds/ad9951.c b/drivers/staging/iio/dds/ad9951.c index a9e56c6..d4dfcd4 100644 --- a/drivers/staging/iio/dds/ad9951.c +++ b/drivers/staging/iio/dds/ad9951.c @@ -166,6 +166,11 @@ static const struct attribute_group ad9951_attribute_group = { .attrs = ad9951_attributes, }; +static const struct iio_info ad9951_info = { + .attrs = &ad9951_attribute_group, + .driver_module = THIS_MODULE, +}; + static int __devinit ad9951_probe(struct spi_device *spi) { struct ad9951_state *st; @@ -187,12 +192,9 @@ static int __devinit ad9951_probe(struct spi_device *spi) goto error_free_st; } st->idev->dev.parent = &spi->dev; - st->idev->num_interrupt_lines = 0; - st->idev->event_attrs = NULL; - st->idev->attrs = &ad9951_attribute_group; + st->idev->info = &ad9951_info; st->idev->dev_data = (void *)(st); - st->idev->driver_module = THIS_MODULE; st->idev->modes = INDIO_DIRECT_MODE; ret = iio_device_register(st->idev); |