staging: iio: push the main buffer chrdev down to the top level.
[deliverable/linux.git] / drivers / staging / iio / adc / max1363_core.c
index e10a4d828146a4c68e0f364436a752a3a03b2c41..53b745143ae3da99be0c0deb81c6bb510f9681be 100644 (file)
@@ -827,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                                            \
@@ -1296,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;
@@ -1313,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)
@@ -1334,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:
@@ -1360,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.024801 seconds and 5 git commands to generate.