staging: iio: push the main buffer chrdev down to the top level.
[deliverable/linux.git] / drivers / staging / iio / adc / max1363_core.c
index 6896b4cddf3d97832a6b7b9a50d2cecfd585c2c5..53b745143ae3da99be0c0deb81c6bb510f9681be 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/err.h>
+#include <linux/module.h>
 
 #include "../iio.h"
 #include "../sysfs.h"
@@ -826,6 +827,7 @@ static struct attribute *max1363_event_attributes[] = {
 
 static struct attribute_group max1363_event_attribute_group = {
        .attrs = max1363_event_attributes,
+       .name = "events",
 };
 
 #define MAX1363_EVENT_FUNCS                                            \
@@ -1295,7 +1297,8 @@ static int __devinit max1363_probe(struct i2c_client *client,
        /* Estabilish that the iio_dev is a child of the i2c device */
        indio_dev->dev.parent = &client->dev;
        indio_dev->name = id->name;
-
+       indio_dev->channels = st->chip_info->channels;
+       indio_dev->num_channels = st->chip_info->num_channels;
        indio_dev->info = st->chip_info->info;
        indio_dev->modes = INDIO_DIRECT_MODE;
        indio_dev->channels = st->chip_info->channels;
@@ -1312,7 +1315,7 @@ static int __devinit max1363_probe(struct i2c_client *client,
        if (ret)
                goto error_cleanup_ring;
        regdone = 1;
-       ret = iio_ring_buffer_register_ex(indio_dev->ring, 0,
+       ret = iio_ring_buffer_register_ex(indio_dev, 0,
                                          st->chip_info->channels,
                                          st->chip_info->num_channels);
        if (ret)
@@ -1333,7 +1336,7 @@ static int __devinit max1363_probe(struct i2c_client *client,
        return 0;
 
 error_uninit_ring:
-       iio_ring_buffer_unregister(indio_dev->ring);
+       iio_ring_buffer_unregister(indio_dev);
 error_cleanup_ring:
        max1363_ring_cleanup(indio_dev);
 error_free_available_scan_masks:
@@ -1359,7 +1362,7 @@ static int max1363_remove(struct i2c_client *client)
 
        if (client->irq)
                free_irq(st->client->irq, indio_dev);
-       iio_ring_buffer_unregister(indio_dev->ring);
+       iio_ring_buffer_unregister(indio_dev);
        max1363_ring_cleanup(indio_dev);
        kfree(indio_dev->available_scan_masks);
        if (!IS_ERR(reg)) {
This page took 0.131637 seconds and 5 git commands to generate.