staging:iio: remove userspace access to bytes per datum.
authorJonathan Cameron <jic23@cam.ac.uk>
Mon, 5 Dec 2011 22:18:13 +0000 (22:18 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Dec 2011 20:08:29 +0000 (12:08 -0800)
There are no known reasons why userspace should want this value.
It can be established from the buffer description anyway.

Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/iio/buffer.h
drivers/staging/iio/industrialio-buffer.c
drivers/staging/iio/kfifo_buf.c
drivers/staging/iio/ring_sw.c

index 97d59d9b022a1cc031673bf881f4edc9ff531344..91717355046e4cac165eef8531eccf814afa3400 100644 (file)
@@ -192,12 +192,6 @@ ssize_t iio_buffer_write_length(struct device *dev,
                              struct device_attribute *attr,
                              const char *buf,
                              size_t len);
-/**
- * iio_buffer_read_bytes_per_datum() - attr for number of bytes in whole datum
- **/
-ssize_t iio_buffer_read_bytes_per_datum(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf);
 /**
  * iio_buffer_store_enable() - attr to turn the buffer on
  **/
@@ -214,9 +208,6 @@ ssize_t iio_buffer_show_enable(struct device *dev,
 #define IIO_BUFFER_LENGTH_ATTR DEVICE_ATTR(length, S_IRUGO | S_IWUSR,  \
                                           iio_buffer_read_length,      \
                                           iio_buffer_write_length)
-#define IIO_BUFFER_BYTES_PER_DATUM_ATTR                                        \
-       DEVICE_ATTR(bytes_per_datum, S_IRUGO | S_IWUSR,                 \
-                   iio_buffer_read_bytes_per_datum, NULL)
 
 #define IIO_BUFFER_ENABLE_ATTR DEVICE_ATTR(enable, S_IRUGO | S_IWUSR,  \
                                           iio_buffer_show_enable,      \
index ff14f124ccf9161e8087470a468d8266be446813..fb6ad39b264a1b8a9c6a4c97e0b69ede8d57ce2a 100644 (file)
@@ -408,21 +408,6 @@ ssize_t iio_buffer_write_length(struct device *dev,
 }
 EXPORT_SYMBOL(iio_buffer_write_length);
 
-ssize_t iio_buffer_read_bytes_per_datum(struct device *dev,
-                                       struct device_attribute *attr,
-                                       char *buf)
-{
-       struct iio_dev *indio_dev = dev_get_drvdata(dev);
-       struct iio_buffer *buffer = indio_dev->buffer;
-
-       if (buffer->access->get_bytes_per_datum)
-               return sprintf(buf, "%d\n",
-                              buffer->access->get_bytes_per_datum(buffer));
-
-       return 0;
-}
-EXPORT_SYMBOL(iio_buffer_read_bytes_per_datum);
-
 ssize_t iio_buffer_store_enable(struct device *dev,
                                struct device_attribute *attr,
                                const char *buf,
index fd98a0ebb5ff099a889091ecb5d24c924a9b76ed..fb3b7ae978d14c82d948232dda1f4de647bf2a18 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,
 };
index 66a34addb75f77bc1e8700eeb3c506b9f3b790d8..98fe81932047ffaefdd71868e37c4adbc5b85499 100644 (file)
@@ -393,13 +393,11 @@ static int iio_mark_update_needed_sw_rb(struct iio_buffer *r)
 }
 
 static IIO_BUFFER_ENABLE_ATTR;
-static IIO_BUFFER_BYTES_PER_DATUM_ATTR;
 static IIO_BUFFER_LENGTH_ATTR;
 
 /* Standard set of ring buffer attributes */
 static struct attribute *iio_ring_attributes[] = {
        &dev_attr_length.attr,
-       &dev_attr_bytes_per_datum.attr,
        &dev_attr_enable.attr,
        NULL,
 };