Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3771a0a8 authored by Jonathan Cameron's avatar Jonathan Cameron Committed by Greg Kroah-Hartman
Browse files

staging:iio: remove userspace access to bytes per datum.



There are no known reasons why userspace should want this value.
It can be established from the buffer description anyway.

Signed-off-by: default avatarJonathan Cameron <jic23@cam.ac.uk>
Acked-by: default avatarLars-Peter Clausen <lars@metafoo.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c15c4f1d
Loading
Loading
Loading
Loading
+0 −9
Original line number Diff line number Diff line
@@ -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,	\
+0 −15
Original line number Diff line number Diff line
@@ -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,
+0 −2
Original line number Diff line number Diff line
@@ -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,
};
+0 −2
Original line number Diff line number Diff line
@@ -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,
};