staging:iio: remove userspace access to bytes per datum.
[cascardo/linux.git] / drivers / staging / iio / kfifo_buf.c
index e8c234b..fb3b7ae 100644 (file)
@@ -75,12 +75,10 @@ static inline void __iio_init_kfifo(struct iio_kfifo *kf)
 }
 
 static IIO_BUFFER_ENABLE_ATTR;
-static IIO_BUFFER_BYTES_PER_DATUM_ATTR;
 static IIO_BUFFER_LENGTH_ATTR;
 
 static struct attribute *iio_kfifo_attributes[] = {
        &dev_attr_length.attr,
-       &dev_attr_bytes_per_datum.attr,
        &dev_attr_enable.attr,
        NULL,
 };
@@ -150,16 +148,9 @@ static int iio_store_to_kfifo(struct iio_buffer *r,
 {
        int ret;
        struct iio_kfifo *kf = iio_to_kfifo(r);
-       u8 *datal = kmalloc(r->bytes_per_datum, GFP_KERNEL);
-       memcpy(datal, data, r->bytes_per_datum - sizeof(timestamp));
-       memcpy(datal + r->bytes_per_datum - sizeof(timestamp),
-               &timestamp, sizeof(timestamp));
        ret = kfifo_in(&kf->kf, data, r->bytes_per_datum);
-       if (ret != r->bytes_per_datum) {
-               kfree(datal);
+       if (ret != r->bytes_per_datum)
                return -EBUSY;
-       }
-       kfree(datal);
        return 0;
 }