/* This function relies on all ring buffer implementations having an iio_ring_buffer as their first element.  */
int iio_ring_open(struct inode *inode, struct file *filp)
/* This function relies on all ring buffer implementations having an iio_ring_buffer as their first element.  */
int iio_ring_open(struct inode *inode, struct file *filp)
{
	struct iio_handler *hand
		= container_of(inode->i_cdev, struct iio_handler, chrdev);
	struct iio_ring_buffer *rb = hand->private;
	filp->private_data = hand->private;
	if (rb->access.mark_in_use)
		rb->access.mark_in_use(rb);
	return 0;
}