From: Souptick Joarder <jrdr.linux@gmail.com>
To: willy@infradead.org, miguel.ojeda.sandonis@gmail.com
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org
Subject: [PATCH] auxdisplay/cfag12864bfb.c: Replace vm_insert_page
Date: Fri, 21 Sep 2018 01:53:16 +0530 [thread overview]
Message-ID: <20180920202316.GA6038@jordon-HP-15-Notebook-PC> (raw)
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
next reply other threads:[~2018-09-20 20:20 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-20 20:23 Souptick Joarder [this message]
2018-09-20 21:26 ` [PATCH] auxdisplay/cfag12864bfb.c: Replace vm_insert_page Miguel Ojeda
2018-09-21 11:07 ` Souptick Joarder
2018-09-22 13:39 ` Miguel Ojeda
2018-09-22 12:21 ` Matthew Wilcox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180920202316.GA6038@jordon-HP-15-Notebook-PC \
--to=jrdr.linux@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=miguel.ojeda.sandonis@gmail.com \
--cc=willy@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox