summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2019-06-14 00:56:21 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2019-06-14 05:34:56 +0200
commit2e3f139e8ecebf177fe01299285a56855e93fb84 (patch)
tree87227a7000e22b20b44b2c7468cf73e51c37b1af /kernel
parentdrivers/base/devres: introduce devm_release_action() (diff)
downloadlinux-2e3f139e8ecebf177fe01299285a56855e93fb84.tar.xz
linux-2e3f139e8ecebf177fe01299285a56855e93fb84.zip
mm/devm_memremap_pages: introduce devm_memunmap_pages
Use the new devm_release_action() facility to allow devm_memremap_pages_release() to be manually triggered. Link: http://lkml.kernel.org/r/155727337088.292046.5774214552136776763.stgit@dwillia2-desk3.amr.corp.intel.com Signed-off-by: Dan Williams <dan.j.williams@intel.com> Reviewed-by: Ira Weiny <ira.weiny@intel.com> Reviewed-by: Logan Gunthorpe <logang@deltatee.com> Cc: Bjorn Helgaas <bhelgaas@google.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: "Jérôme Glisse" <jglisse@redhat.com> Cc: "Rafael J. Wysocki" <rafael@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/memremap.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/kernel/memremap.c b/kernel/memremap.c
index 1490e63f69a9..715b434bd316 100644
--- a/kernel/memremap.c
+++ b/kernel/memremap.c
@@ -271,6 +271,12 @@ void *devm_memremap_pages(struct device *dev, struct dev_pagemap *pgmap)
}
EXPORT_SYMBOL_GPL(devm_memremap_pages);
+void devm_memunmap_pages(struct device *dev, struct dev_pagemap *pgmap)
+{
+ devm_release_action(dev, devm_memremap_pages_release, pgmap);
+}
+EXPORT_SYMBOL_GPL(devm_memunmap_pages);
+
unsigned long vmem_altmap_offset(struct vmem_altmap *altmap)
{
/* number of pfns from base where pfn_to_page() is valid */