Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1119707e authored by Prathyush K's avatar Prathyush K Committed by Inki Dae
Browse files

drm/exynos: remove unnecessary sg_alloc_table call



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: default avatarPrathyush K <prathyush.k@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
parent 4ddc404b
Loading
Loading
Loading
Loading
+1 −7
Original line number Original line Diff line number Diff line
@@ -40,21 +40,15 @@ static struct sg_table *exynos_get_sgt(struct drm_device *drm_dev,
	if (!sgt)
	if (!sgt)
		goto out;
		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,
	ret = dma_get_sgtable(drm_dev->dev, sgt, buf->kvaddr,
				buf->dma_addr, buf->size);
				buf->dma_addr, buf->size);
	if (ret < 0) {
	if (ret < 0) {
		DRM_ERROR("failed to get sgtable.\n");
		DRM_ERROR("failed to get sgtable.\n");
		goto err_free_table;
		goto err_free_sgt;
	}
	}


	return sgt;
	return sgt;


err_free_table:
	sg_free_table(sgt);
err_free_sgt:
err_free_sgt:
	kfree(sgt);
	kfree(sgt);
	sgt = NULL;
	sgt = NULL;