Commit 8c5fb947 authored by Gwenhael Goavec-Merou's avatar Gwenhael Goavec-Merou Committed by Vaibhav Gupta

software/kernel/fac-core: fix build with kernel >= 5.15.0

Signed-off-by: 's avatarGwenhael Goavec-Merou <gwenhael.goavec-merou@trabucayre.com>
parent 9cf28eed
......@@ -52,6 +52,10 @@ static int fa_sg_alloc_table_from_pages(struct sg_table *sgt,
gfp_t gfp_mask)
{
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
#if KERNEL_VERSION(5, 15, 0) <= LINUX_VERSION_CODE
return sg_alloc_table_from_pages_segment(sgt, pages, n_pages, offset,
size, max_segment, gfp_mask);
#else
struct scatterlist *sg;
sg = __sg_alloc_table_from_pages(sgt, pages, n_pages, offset, size,
......@@ -60,6 +64,7 @@ static int fa_sg_alloc_table_from_pages(struct sg_table *sgt,
return PTR_ERR(sg);
else
return 0;
#endif
#else
return __sg_alloc_table_from_pages(sgt, pages, n_pages, offset, size,
max_segment, gfp_mask);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment