mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-12-22 13:33:40 +00:00
[module] fix compilation for linux 5.6
This commit is contained in:
parent
2440272307
commit
1ac13658e1
@ -28,6 +28,7 @@ Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#include <linux/fs.h>
|
||||
#include <linux/dma-buf.h>
|
||||
#include <linux/highmem.h>
|
||||
#include <linux/version.h>
|
||||
|
||||
#include <asm/io.h>
|
||||
|
||||
@ -122,27 +123,10 @@ static void unmap_kvmfrbuf(struct dma_buf_attachment * at, struct sg_table * sg,
|
||||
static void release_kvmfrbuf(struct dma_buf * buf)
|
||||
{
|
||||
struct kvmfrbuf *kbuf = (struct kvmfrbuf *)buf->priv;
|
||||
pgoff_t pg;
|
||||
|
||||
for (pg = 0; pg < kbuf->pagecount; pg++)
|
||||
put_page(kbuf->pages[pg]);
|
||||
|
||||
kfree(kbuf->pages);
|
||||
kfree(kbuf);
|
||||
}
|
||||
|
||||
static void * kmap_kvmfrbuf(struct dma_buf * buf, unsigned long page_num)
|
||||
{
|
||||
struct kvmfrbuf * kbuf = (struct kvmfrbuf *)buf->priv;
|
||||
struct page * page = kbuf->pages[page_num];
|
||||
return kmap(page);
|
||||
}
|
||||
|
||||
static void kunmap_kvmfrbuf(struct dma_buf * buf, unsigned long page_num, void * vaddr)
|
||||
{
|
||||
kunmap(vaddr);
|
||||
}
|
||||
|
||||
static int mmap_kvmfrbuf(struct dma_buf * buf, struct vm_area_struct * vma)
|
||||
{
|
||||
if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0)
|
||||
@ -157,8 +141,6 @@ static const struct dma_buf_ops kvmfrbuf_ops =
|
||||
.map_dma_buf = map_kvmfrbuf,
|
||||
.unmap_dma_buf = unmap_kvmfrbuf,
|
||||
.release = release_kvmfrbuf,
|
||||
.map = kmap_kvmfrbuf,
|
||||
.unmap = kunmap_kvmfrbuf,
|
||||
.mmap = mmap_kvmfrbuf
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user