Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

hpet: replace deprecated mmap hook with mmap_prepare

The f_op->mmap interface is deprecated, so update driver to use its
successor, mmap_prepare.

The driver previously used vm_iomap_memory(), so this change replaces it
with its mmap_prepare equivalent, mmap_action_simple_ioremap().

Link: https://lkml.kernel.org/r/094c5fcfb2459a4f6d791b1fb852b01e252a44d4.1774045440.git.ljs@kernel.org
Signed-off-by: Lorenzo Stoakes (Oracle) <ljs@kernel.org>
Reviewed-by: Suren Baghdasaryan <surenb@google.com>
Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexandre Torgue <alexandre.torgue@foss.st.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bodo Stroesser <bostroesser@gmail.com>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Clemens Ladisch <clemens@ladisch.de>
Cc: David Hildenbrand <david@kernel.org>
Cc: David Howells <dhowells@redhat.com>
Cc: Dexuan Cui <decui@microsoft.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Long Li <longli@microsoft.com>
Cc: Marc Dionne <marc.dionne@auristor.com>
Cc: "Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Maxime Coquelin <mcoquelin.stm32@gmail.com>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Mike Rapoport <rppt@kernel.org>
Cc: Miquel Raynal <miquel.raynal@bootlin.com>
Cc: Pedro Falcato <pfalcato@suse.de>
Cc: Richard Weinberger <richard@nod.at>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Cc: Vignesh Raghavendra <vigneshr@ti.com>
Cc: Wei Liu <wei.liu@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lorenzo Stoakes (Oracle) and committed by
Andrew Morton
10de8b81 d8bc7934

+7 -5
+7 -5
drivers/char/hpet.c
··· 354 354 } 355 355 __setup("hpet_mmap=", hpet_mmap_enable); 356 356 357 - static int hpet_mmap(struct file *file, struct vm_area_struct *vma) 357 + static int hpet_mmap_prepare(struct vm_area_desc *desc) 358 358 { 359 + struct file *file = desc->file; 359 360 struct hpet_dev *devp; 360 361 unsigned long addr; 361 362 ··· 369 368 if (addr & (PAGE_SIZE - 1)) 370 369 return -ENOSYS; 371 370 372 - vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot); 373 - return vm_iomap_memory(vma, addr, PAGE_SIZE); 371 + desc->page_prot = pgprot_noncached(desc->page_prot); 372 + mmap_action_simple_ioremap(desc, addr, PAGE_SIZE); 373 + return 0; 374 374 } 375 375 #else 376 - static int hpet_mmap(struct file *file, struct vm_area_struct *vma) 376 + static int hpet_mmap_prepare(struct vm_area_desc *desc) 377 377 { 378 378 return -ENOSYS; 379 379 } ··· 712 710 .open = hpet_open, 713 711 .release = hpet_release, 714 712 .fasync = hpet_fasync, 715 - .mmap = hpet_mmap, 713 + .mmap_prepare = hpet_mmap_prepare, 716 714 }; 717 715 718 716 static int hpet_is_known(struct hpet_data *hdp)