Lines Matching refs:attach
196 * calls attach() of dma_buf_ops to allow device-specific attach functionality
197 * @dmabuf: [in] buffer to attach device to.
207 struct dma_buf_attachment *attach;
213 attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
214 if (attach == NULL)
217 attach->dev = dev;
218 attach->dmabuf = dmabuf;
222 if (dmabuf->ops->attach) {
223 ret = dmabuf->ops->attach(dmabuf, dev, attach);
227 list_add(&attach->node, &dmabuf->attachments);
230 return attach;
233 kfree(attach);
243 * @attach: [in] attachment to be detached; is free'd after this call.
246 void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)
248 if (WARN_ON(!dmabuf || !attach))
252 list_del(&attach->node);
254 dmabuf->ops->detach(dmabuf, attach);
257 kfree(attach);
265 * @attach: [in] attachment whose scatterlist is to be returned
272 struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,
279 if (WARN_ON(!attach || !attach->dmabuf))
282 sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
292 * @attach: [in] attachment to unmap buffer from
297 void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
301 if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
304 attach->dmabuf->ops->unmap_dma_buf(attach, sg_table,