diff options
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/mm_gk20a.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c index 0ddd9ecb..e2e5fdd7 100644 --- a/drivers/gpu/nvgpu/gk20a/mm_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/mm_gk20a.c | |||
@@ -1735,12 +1735,12 @@ int gk20a_get_sgtable_from_pages(struct device *d, struct sg_table **sgt, | |||
1735 | err = -ENOMEM; | 1735 | err = -ENOMEM; |
1736 | goto fail; | 1736 | goto fail; |
1737 | } | 1737 | } |
1738 | err = sg_alloc_table(*sgt, 1, GFP_KERNEL); | 1738 | err = sg_alloc_table_from_pages(*sgt, pages, |
1739 | DIV_ROUND_UP(size, 4096), 0, size, GFP_KERNEL); | ||
1739 | if (err) { | 1740 | if (err) { |
1740 | dev_err(d, "failed to allocate sg_table\n"); | 1741 | dev_err(d, "failed to allocate sg_table\n"); |
1741 | goto fail; | 1742 | goto fail; |
1742 | } | 1743 | } |
1743 | sg_set_page((*sgt)->sgl, *pages, size, 0); | ||
1744 | sg_dma_address((*sgt)->sgl) = iova; | 1744 | sg_dma_address((*sgt)->sgl) = iova; |
1745 | 1745 | ||
1746 | return 0; | 1746 | return 0; |