]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
iio: buffer: use dma_buf_unmap_attachment_unlocked() helper
authorLiang Jie <liangjie@lixiang.com>
Fri, 14 Nov 2025 08:47:25 +0000 (16:47 +0800)
committerJonathan Cameron <Jonathan.Cameron@huawei.com>
Sat, 15 Nov 2025 17:31:31 +0000 (17:31 +0000)
Replace open-coded dma_resv_lock()/dma_resv_unlock() around
dma_buf_unmap_attachment() in iio_buffer_dmabuf_release() with the
dma_buf_unmap_attachment_unlocked() helper.

This aligns with the standard DMA-BUF API, avoids duplicating
locking logic and eases future maintenance. No functional change.

Reviewed-by: fanggeng <fanggeng@lixiang.com>
Signed-off-by: Liang Jie <liangjie@lixiang.com>
Reviewed-by: Nuno Sá <nuno.sa@analog.com>
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
drivers/iio/industrialio-buffer.c

index f1448ae1b843fc577599fc1b9cf6d859bba226f1..b9ebb6f43404798a6866912e8141246e13b92e34 100644 (file)
@@ -1563,9 +1563,7 @@ static void iio_buffer_dmabuf_release(struct kref *ref)
        struct iio_buffer *buffer = priv->buffer;
        struct dma_buf *dmabuf = attach->dmabuf;
 
-       dma_resv_lock(dmabuf->resv, NULL);
-       dma_buf_unmap_attachment(attach, priv->sgt, priv->dir);
-       dma_resv_unlock(dmabuf->resv);
+       dma_buf_unmap_attachment_unlocked(attach, priv->sgt, priv->dir);
 
        buffer->access->detach_dmabuf(buffer, priv->block);