staging: iio: push the main buffer chrdev down to the top level.
[deliverable/linux.git] / drivers / staging / iio / Documentation / generic_buffer.c
index f82894f42d27f96c196fc8d964d8fa7634360b96..d58095321491449986c0a3dd51aedf58223a3aa3 100644 (file)
@@ -173,7 +173,7 @@ int main(int argc, char **argv)
                return -1;
 
        /* Find the device requested */
-       dev_num = find_type_by_name(device_name, "device");
+       dev_num = find_type_by_name(device_name, "iio:device");
        if (dev_num < 0) {
                printf("Failed to find the %s\n", device_name);
                ret = -ENODEV;
@@ -181,7 +181,7 @@ int main(int argc, char **argv)
        }
        printf("iio device number being used is %d\n", dev_num);
 
-       asprintf(&dev_dir_name, "%sdevice%d", iio_dir, dev_num);
+       asprintf(&dev_dir_name, "%siio:device%d", iio_dir, dev_num);
        if (trigger_name == NULL) {
                /*
                 * Build the trigger name. If it is device associated it's
@@ -212,6 +212,7 @@ int main(int argc, char **argv)
        ret = build_channel_array(dev_dir_name, &infoarray, &num_channels);
        if (ret) {
                printf("Problem reading scan element information\n");
+               printf("diag %s\n", dev_dir_name);
                goto error_free_triggername;
        }
 
@@ -220,7 +221,8 @@ int main(int argc, char **argv)
         * As we know that the lis3l02dq has only one buffer this may
         * be built rather than found.
         */
-       ret = asprintf(&buf_dir_name, "%sdevice%d:buffer0", iio_dir, dev_num);
+       ret = asprintf(&buf_dir_name,
+                      "%siio:device%d/buffer", iio_dir, dev_num);
        if (ret < 0) {
                ret = -ENOMEM;
                goto error_free_triggername;
@@ -251,9 +253,7 @@ int main(int argc, char **argv)
                goto error_free_buf_dir_name;
        }
 
-       ret = asprintf(&buffer_access,
-                      "/dev/device%d:buffer0",
-                      dev_num);
+       ret = asprintf(&buffer_access, "/dev/iio:device%d", dev_num);
        if (ret < 0) {
                ret = -ENOMEM;
                goto error_free_data;
This page took 0.032347 seconds and 5 git commands to generate.