Merge drm/drm-next into drm-misc-next
[sfrench/cifs-2.6.git] / drivers / gpu / drm / i915 / gem / selftests / mock_dmabuf.c
index 7dfef531f6d4a12c76526b53670f2ab149d32f12..2855d11c7a51c01c8e273479c87b9380c628069c 100644 (file)
@@ -28,10 +28,9 @@ static struct sg_table *mock_map_dma_buf(struct dma_buf_attachment *attachment,
                sg = sg_next(sg);
        }
 
-       if (!dma_map_sg(attachment->dev, st->sgl, st->nents, dir)) {
-               err = -ENOMEM;
+       err = dma_map_sgtable(attachment->dev, st, dir, 0);
+       if (err)
                goto err_st;
-       }
 
        return st;
 
@@ -46,7 +45,7 @@ static void mock_unmap_dma_buf(struct dma_buf_attachment *attachment,
                               struct sg_table *st,
                               enum dma_data_direction dir)
 {
-       dma_unmap_sg(attachment->dev, st->sgl, st->nents, dir);
+       dma_unmap_sgtable(attachment->dev, st, dir, 0);
        sg_free_table(st);
        kfree(st);
 }