aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2013-08-14 18:02:41 -0400
committerDave Airlie <airlied@redhat.com>2013-08-20 22:53:46 -0400
commit4332bf438bbbc31319abed61d2ac6d9932ff980c (patch)
treecfa59641788eedac7ad58d063d3d054be11542fa
parentbecee2a57fd2b64c53ebef58277fbca895cf8ec1 (diff)
drm/prime: use proper pointer in drm_gem_prime_handle_to_fd
Part of the function uses the properly-typed dmabuf variable, the other an untyped void *buf. Kill the later. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r--drivers/gpu/drm/drm_prime.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c
index 82cd83e62e7d..c2d6d54e10e0 100644
--- a/drivers/gpu/drm/drm_prime.c
+++ b/drivers/gpu/drm/drm_prime.c
@@ -303,7 +303,6 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
303 int *prime_fd) 303 int *prime_fd)
304{ 304{
305 struct drm_gem_object *obj; 305 struct drm_gem_object *obj;
306 void *buf;
307 int ret = 0; 306 int ret = 0;
308 struct dma_buf *dmabuf; 307 struct dma_buf *dmabuf;
309 308
@@ -323,15 +322,15 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
323 goto out_have_obj; 322 goto out_have_obj;
324 } 323 }
325 324
326 buf = dev->driver->gem_prime_export(dev, obj, flags); 325 dmabuf = dev->driver->gem_prime_export(dev, obj, flags);
327 if (IS_ERR(buf)) { 326 if (IS_ERR(dmabuf)) {
328 /* normally the created dma-buf takes ownership of the ref, 327 /* normally the created dma-buf takes ownership of the ref,
329 * but if that fails then drop the ref 328 * but if that fails then drop the ref
330 */ 329 */
331 ret = PTR_ERR(buf); 330 ret = PTR_ERR(dmabuf);
332 goto out; 331 goto out;
333 } 332 }
334 obj->export_dma_buf = buf; 333 obj->export_dma_buf = dmabuf;
335 334
336 /* if we've exported this buffer the cheat and add it to the import list 335 /* if we've exported this buffer the cheat and add it to the import list
337 * so we get the correct handle back 336 * so we get the correct handle back
@@ -341,7 +340,7 @@ int drm_gem_prime_handle_to_fd(struct drm_device *dev,
341 if (ret) 340 if (ret)
342 goto fail_put_dmabuf; 341 goto fail_put_dmabuf;
343 342
344 ret = dma_buf_fd(buf, flags); 343 ret = dma_buf_fd(dmabuf, flags);
345 if (ret < 0) 344 if (ret < 0)
346 goto fail_rm_handle; 345 goto fail_rm_handle;
347 346
@@ -362,11 +361,12 @@ out_have_obj:
362 goto out; 361 goto out;
363 362
364fail_rm_handle: 363fail_rm_handle:
365 drm_prime_remove_buf_handle_locked(&file_priv->prime, buf); 364 drm_prime_remove_buf_handle_locked(&file_priv->prime,
365 dmabuf);
366fail_put_dmabuf: 366fail_put_dmabuf:
367 /* clear NOT to be checked when releasing dma_buf */ 367 /* clear NOT to be checked when releasing dma_buf */
368 obj->export_dma_buf = NULL; 368 obj->export_dma_buf = NULL;
369 dma_buf_put(buf); 369 dma_buf_put(dmabuf);
370out: 370out:
371 drm_gem_object_unreference_unlocked(obj); 371 drm_gem_object_unreference_unlocked(obj);
372 mutex_unlock(&file_priv->prime.lock); 372 mutex_unlock(&file_priv->prime.lock);