Skip to content

Commit

Permalink
Fix driver for linux >= 4.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrien Prost-Boucle committed Feb 13, 2017
1 parent c84ece4 commit dbab23d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion driver/linux/riffa_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -443,8 +443,10 @@ static inline struct sg_mapping * fill_sg_buf(struct fpga_state * sc, int chnl,
down_read(&current->mm->mmap_sem);
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
num_pages = get_user_pages(current, current->mm, udata, num_pages_reqd, 1, 0, pages, NULL);
#else
#elsif LINUX_VERSION_CODE < KERNEL_VERSION(4,9,0)
num_pages = get_user_pages(udata, num_pages_reqd, 1, 0, pages, NULL);
#else
num_pages = get_user_pages(udata, num_pages_reqd, FOLL_WRITE, pages, NULL);
#endif
up_read(&current->mm->mmap_sem);
if (num_pages <= 0) {
Expand Down

0 comments on commit dbab23d

Please sign in to comment.