Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297191
b: refs/heads/master
c: d1aa06a
h: refs/heads/master
i:
  297189: ad2406c
  297187: 42af26e
  297183: 696e256
v: v3
  • Loading branch information
Laurent Pinchart authored and Sumit Semwal committed Mar 19, 2012
1 parent f599116 commit dea7b5a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5375764f9408b8ef1fb8d6cd1ed0efd97dce4824
refs/heads/master: d1aa06a1eaf5f751c9913703031d611599d8d3d7
15 changes: 6 additions & 9 deletions trunk/drivers/base/dma-buf.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ struct dma_buf_attachment *dma_buf_attach(struct dma_buf *dmabuf,
struct dma_buf_attachment *attach;
int ret;

if (WARN_ON(!dmabuf || !dev || !dmabuf->ops))
if (WARN_ON(!dmabuf || !dev))
return ERR_PTR(-EINVAL);

attach = kzalloc(sizeof(struct dma_buf_attachment), GFP_KERNEL);
Expand Down Expand Up @@ -224,7 +224,7 @@ EXPORT_SYMBOL_GPL(dma_buf_attach);
*/
void dma_buf_detach(struct dma_buf *dmabuf, struct dma_buf_attachment *attach)
{
if (WARN_ON(!dmabuf || !attach || !dmabuf->ops))
if (WARN_ON(!dmabuf || !attach))
return;

mutex_lock(&dmabuf->lock);
Expand Down Expand Up @@ -255,12 +255,11 @@ struct sg_table *dma_buf_map_attachment(struct dma_buf_attachment *attach,

might_sleep();

if (WARN_ON(!attach || !attach->dmabuf || !attach->dmabuf->ops))
if (WARN_ON(!attach || !attach->dmabuf))
return ERR_PTR(-EINVAL);

mutex_lock(&attach->dmabuf->lock);
if (attach->dmabuf->ops->map_dma_buf)
sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
sg_table = attach->dmabuf->ops->map_dma_buf(attach, direction);
mutex_unlock(&attach->dmabuf->lock);

return sg_table;
Expand All @@ -278,13 +277,11 @@ EXPORT_SYMBOL_GPL(dma_buf_map_attachment);
void dma_buf_unmap_attachment(struct dma_buf_attachment *attach,
struct sg_table *sg_table)
{
if (WARN_ON(!attach || !attach->dmabuf || !sg_table
|| !attach->dmabuf->ops))
if (WARN_ON(!attach || !attach->dmabuf || !sg_table))
return;

mutex_lock(&attach->dmabuf->lock);
if (attach->dmabuf->ops->unmap_dma_buf)
attach->dmabuf->ops->unmap_dma_buf(attach, sg_table);
attach->dmabuf->ops->unmap_dma_buf(attach, sg_table);
mutex_unlock(&attach->dmabuf->lock);

}
Expand Down

0 comments on commit dea7b5a

Please sign in to comment.