From: Liang Jie Date: Fri, 14 Nov 2025 08:47:25 +0000 (+0800) Subject: iio: buffer: use dma_buf_unmap_attachment_unlocked() helper X-Git-Tag: v6.19-rc1~65^2~58^2~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0de73abe5f5c2b58d66d6dcb7d44df05b0f73684;p=thirdparty%2Fkernel%2Flinux.git iio: buffer: use dma_buf_unmap_attachment_unlocked() helper 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 Signed-off-by: Liang Jie Reviewed-by: Nuno Sá Signed-off-by: Jonathan Cameron --- diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c index f1448ae1b843f..b9ebb6f434047 100644 --- a/drivers/iio/industrialio-buffer.c +++ b/drivers/iio/industrialio-buffer.c @@ -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);