From dea7b5af52c376720a64cbd02a4f27c3734ed4e0 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 26 Jan 2012 12:27:23 +0100 Subject: [PATCH] --- yaml --- r: 297191 b: refs/heads/master c: d1aa06a1eaf5f751c9913703031d611599d8d3d7 h: refs/heads/master i: 297189: ad2406c3d8f7c23657f5d1266d0ec41478d9348b 297187: 42af26e1f943005faf00c27b3be788d560d99b1c 297183: 696e2567d86d1a2585a26ea91008c8f5e10ddef1 v: v3 --- [refs] | 2 +- trunk/drivers/base/dma-buf.c | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/[refs] b/[refs] index 9ba8aab29c5b..910a0ead6678 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 5375764f9408b8ef1fb8d6cd1ed0efd97dce4824 +refs/heads/master: d1aa06a1eaf5f751c9913703031d611599d8d3d7 diff --git a/trunk/drivers/base/dma-buf.c b/trunk/drivers/base/dma-buf.c index 965833acf0d2..198edd8a9f0a 100644 --- a/trunk/drivers/base/dma-buf.c +++ b/trunk/drivers/base/dma-buf.c @@ -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); @@ -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); @@ -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; @@ -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); }