mirror of
https://github.com/torvalds/linux.git
synced 2026-06-04 12:35:52 +02:00
dma: convert dma_buf_fd() to FD_ADD()
Link: https://patch.msgid.link/20251123-work-fd-prepare-v4-18-b6efa1706cfd@kernel.org Signed-off-by: Christian Brauner <brauner@kernel.org>
This commit is contained in:
parent
993f30468e
commit
34dfce523c
|
|
@ -768,18 +768,10 @@ EXPORT_SYMBOL_NS_GPL(dma_buf_export, "DMA_BUF");
|
||||||
*/
|
*/
|
||||||
int dma_buf_fd(struct dma_buf *dmabuf, int flags)
|
int dma_buf_fd(struct dma_buf *dmabuf, int flags)
|
||||||
{
|
{
|
||||||
int fd;
|
|
||||||
|
|
||||||
if (!dmabuf || !dmabuf->file)
|
if (!dmabuf || !dmabuf->file)
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
fd = get_unused_fd_flags(flags);
|
return FD_ADD(flags, dmabuf->file);
|
||||||
if (fd < 0)
|
|
||||||
return fd;
|
|
||||||
|
|
||||||
fd_install(fd, dmabuf->file);
|
|
||||||
|
|
||||||
return fd;
|
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL_NS_GPL(dma_buf_fd, "DMA_BUF");
|
EXPORT_SYMBOL_NS_GPL(dma_buf_fd, "DMA_BUF");
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user