diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2023-09-22 10:04:56 +0200 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2023-10-12 09:20:46 +0200 |
commit | 052ddf7b86d2d9443bce77ef5b5b1ef61a3b79fc (patch) | |
tree | cba604afadc8aca42d2f5ce253c7dff4168e0da0 /arch/powerpc/include/asm/fb.h | |
parent | fbdev: Avoid file argument in fb_pgprotect() (diff) | |
download | linux-052ddf7b86d2d9443bce77ef5b5b1ef61a3b79fc.tar.xz linux-052ddf7b86d2d9443bce77ef5b5b1ef61a3b79fc.zip |
fbdev: Replace fb_pgprotect() with pgprot_framebuffer()
Rename the fbdev mmap helper fb_pgprotect() to pgprot_framebuffer().
The helper sets VMA page-access flags for framebuffers in device I/O
memory.
Also clean up the helper's parameters and return value. Instead of
the VMA instance, pass the individial parameters separately: existing
page-access flags, the VMAs start and end addresses and the offset
in the underlying device memory rsp file. Return the new page-access
flags. These changes align pgprot_framebuffer() with other pgprot_()
functions.
v4:
* fix commit message (Christophe)
v3:
* rename fb_pgprotect() to pgprot_framebuffer() (Arnd)
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org> # m68k
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230922080636.26762-3-tzimmermann@suse.de
Diffstat (limited to 'arch/powerpc/include/asm/fb.h')
-rw-r--r-- | arch/powerpc/include/asm/fb.h | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/arch/powerpc/include/asm/fb.h b/arch/powerpc/include/asm/fb.h index 61e3b8806db6..3cecf14d51de 100644 --- a/arch/powerpc/include/asm/fb.h +++ b/arch/powerpc/include/asm/fb.h @@ -2,23 +2,20 @@ #ifndef _ASM_FB_H_ #define _ASM_FB_H_ -#include <linux/fs.h> - #include <asm/page.h> -static inline void fb_pgprotect(struct file *file, struct vm_area_struct *vma, - unsigned long off) +static inline pgprot_t pgprot_framebuffer(pgprot_t prot, + unsigned long vm_start, unsigned long vm_end, + unsigned long offset) { /* * PowerPC's implementation of phys_mem_access_prot() does * not use the file argument. Set it to NULL in preparation * of later updates to the interface. */ - vma->vm_page_prot = phys_mem_access_prot(NULL, PHYS_PFN(off), - vma->vm_end - vma->vm_start, - vma->vm_page_prot); + return phys_mem_access_prot(NULL, PHYS_PFN(offset), vm_end - vm_start, prot); } -#define fb_pgprotect fb_pgprotect +#define pgprot_framebuffer pgprot_framebuffer #include <asm-generic/fb.h> |