/* This function relies on all ring buffer implementations having an iio_ring_buffer as their first element.  */
int iio_ring_release(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_release(struct inode *inode, struct file *filp)
{
	struct cdev *cd = inode->i_cdev;
	struct iio_handler *hand = iio_cdev_to_handler(cd);
	struct iio_ring_buffer *rb = hand->private;
	clear_bit(IIO_BUSY_BIT_POS, &rb->access_handler.flags);
	if (rb->access.unmark_in_use)
		rb->access.unmark_in_use(rb);
	return 0;
}