Skip to content

Commit 363eb9b

Browse files
Liang Jiegregkh
authored andcommitted
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 <fanggeng@lixiang.com> Signed-off-by: Liang Jie <liangjie@lixiang.com> Link: https://patch.msgid.link/20251114084246.2064845-1-buaajxlj@163.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 24b040f commit 363eb9b

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

  • drivers/usb/gadget/function

drivers/usb/gadget/function/f_fs.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,9 +1306,7 @@ static void ffs_dmabuf_release(struct kref *ref)
13061306
struct dma_buf *dmabuf = attach->dmabuf;
13071307

13081308
pr_vdebug("FFS DMABUF release\n");
1309-
dma_resv_lock(dmabuf->resv, NULL);
1310-
dma_buf_unmap_attachment(attach, priv->sgt, priv->dir);
1311-
dma_resv_unlock(dmabuf->resv);
1309+
dma_buf_unmap_attachment_unlocked(attach, priv->sgt, priv->dir);
13121310

13131311
dma_buf_detach(attach->dmabuf, attach);
13141312
dma_buf_put(dmabuf);

0 commit comments

Comments
 (0)