staging: gasket: fix compilation on 5.1+

https://lore.kernel.org/patchwork/patch/1039724/

Bug: 158716452
Change-Id: I3c90a6524d3859e5518b7aece5a2817ed1f3efed
(cherry picked from commit 0aacc629f48459a1f8169120afc868cdb48f0593)
This commit is contained in:
Jonas Larsson
2020-06-11 09:19:54 -07:00
committed by Leonid Lobachev
parent b20a2f21c3
commit 64728f3114

View File

@@ -50,6 +50,7 @@
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/pagemap.h>
#include <linux/version.h>
#include <linux/vmalloc.h>
#include "gasket_constants.h"
@@ -532,7 +533,12 @@ static int gasket_perform_mapping(struct gasket_page_table *pg_tbl,
return -EINVAL;
/* Page already mapped for DMA. */
#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 1, 0)
ptes[i].dma_addr = sg_page_iter_dma_address(sg_iter);
#else
ptes[i].dma_addr = sg_page_iter_dma_address(
container_of(sg_iter, struct sg_dma_page_iter, base));
#endif
ptes[i].page = NULL;
offset = 0;
} else if (is_coherent(pg_tbl, host_addr)) {