linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] auxdisplay/cfag12864bfb.c: Replace vm_insert_page
@ 2018-09-20 20:23 Souptick Joarder
  2018-09-20 21:26 ` Miguel Ojeda
  2018-09-22 12:21 ` Matthew Wilcox
  0 siblings, 2 replies; 5+ messages in thread
From: Souptick Joarder @ 2018-09-20 20:23 UTC (permalink / raw)
  To: willy, miguel.ojeda.sandonis; +Cc: linux-kernel, akpm

There is a plan to remove vm_insert_page permanently
and replace it with new API vmf_insert_page which will
return vm_fault_t type. As part of it vm_insert_page
is removed from this driver.

remap_pfn_range() will be used to map kernel memory to
user vma.

Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com>
---
 drivers/auxdisplay/cfag12864bfb.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index 40c8a55..3b4411d 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -52,8 +52,12 @@
 
 static int cfag12864bfb_mmap(struct fb_info *info, struct vm_area_struct *vma)
 {
-	return vm_insert_page(vma, vma->vm_start,
-		virt_to_page(cfag12864b_buffer));
+	struct page *page;
+	unsigned long size = vma->vm_end - vma->vm_start;
+
+	page = virt_to_page(cfag12864b_buffer);
+	return remap_pfn_range(vma, vma->vm_start, page_to_pfn(page),
+				size, vma->vm_page_prot);
 }
 
 static struct fb_ops cfag12864bfb_ops = {
-- 
1.9.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-09-22 13:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-20 20:23 [PATCH] auxdisplay/cfag12864bfb.c: Replace vm_insert_page Souptick Joarder
2018-09-20 21:26 ` Miguel Ojeda
2018-09-21 11:07   ` Souptick Joarder
2018-09-22 13:39     ` Miguel Ojeda
2018-09-22 12:21 ` Matthew Wilcox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).