From: Liang Jie Date: Fri, 14 Nov 2025 08:42:44 +0000 (+0800) Subject: usb: gadget: functionfs: use dma_buf_unmap_attachment_unlocked() helper X-Git-Tag: v6.19-rc1~63^2~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=363eb9bfdea537c456cec62c0560ab7d386c555c;p=thirdparty%2Flinux.git usb: gadget: functionfs: use dma_buf_unmap_attachment_unlocked() helper Replace the open-coded dma_resv_lock()/dma_resv_unlock() around dma_buf_unmap_attachment() in ffs_dmabuf_release() with the dma_buf_unmap_attachment_unlocked() helper. This aligns FunctionFS DMABUF unmap handling 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 Link: https://patch.msgid.link/20251114084246.2064845-1-buaajxlj@163.com Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c index 47cfbe41fdff8..7f8e566b1c57a 100644 --- a/drivers/usb/gadget/function/f_fs.c +++ b/drivers/usb/gadget/function/f_fs.c @@ -1306,9 +1306,7 @@ static void ffs_dmabuf_release(struct kref *ref) struct dma_buf *dmabuf = attach->dmabuf; pr_vdebug("FFS DMABUF release\n"); - 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); dma_buf_detach(attach->dmabuf, attach); dma_buf_put(dmabuf);