drm/exynos: remove unnecessary sg_alloc_table call
authorPrathyush K <prathyush.k@samsung.com>
Wed, 7 Nov 2012 10:28:58 +0000 (15:58 +0530)
committerInki Dae <inki.dae@samsung.com>
Tue, 4 Dec 2012 05:46:00 +0000 (14:46 +0900)
The function dma_get_sgtable will allocate a sg table internally so
it is not necessary to allocate a sg table before it. The unnecessary
'sg_alloc_table' call is removed.

Signed-off-by: Prathyush K <prathyush.k@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drivers/gpu/drm/exynos/exynos_drm_dmabuf.c

index b98da307faec96a1cd1607c329545bca848d1623..d9307bd29738c70166a5de82baa429e9c8caa990 100644 (file)
@@ -40,21 +40,15 @@ static struct sg_table *exynos_get_sgt(struct drm_device *drm_dev,
        if (!sgt)
                goto out;
 
-       ret = sg_alloc_table(sgt, buf->sgt->nents, GFP_KERNEL);
-       if (ret)
-               goto err_free_sgt;
-
        ret = dma_get_sgtable(drm_dev->dev, sgt, buf->kvaddr,
                                buf->dma_addr, buf->size);
        if (ret < 0) {
                DRM_ERROR("failed to get sgtable.\n");
-               goto err_free_table;
+               goto err_free_sgt;
        }
 
        return sgt;
 
-err_free_table:
-       sg_free_table(sgt);
 err_free_sgt:
        kfree(sgt);
        sgt = NULL;