summaryrefslogtreecommitdiff
path: root/drivers/nvdimm
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2015-09-15 02:14:03 -0400
committerDan Williams <dan.j.williams@intel.com>2015-10-09 17:00:32 -0400
commita639315d6c536c806724c9328941a2517507e3e3 (patch)
tree392e1082c2dcfe5ca0b2d8e4394c4be5ed0b403b /drivers/nvdimm
parentc9cdaeb2027e535b956ff69f215522d79f6b54e3 (diff)
downloadlwn-a639315d6c536c806724c9328941a2517507e3e3.tar.gz
lwn-a639315d6c536c806724c9328941a2517507e3e3.zip
pmem: kill memremap_pmem()
Now that the pmem-api is defined as "a set of apis that enables access to WB mapped pmem", the mapping type is implied. Remove the wrapper and push the functionality down into the pmem driver in preparation for adding support for direct-mapped pmem. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm')
-rw-r--r--drivers/nvdimm/pmem.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/nvdimm/pmem.c b/drivers/nvdimm/pmem.c
index 0ba6a978f227..0680affae04a 100644
--- a/drivers/nvdimm/pmem.c
+++ b/drivers/nvdimm/pmem.c
@@ -157,8 +157,9 @@ static struct pmem_device *pmem_alloc(struct device *dev,
return addr;
pmem->virt_addr = (void __pmem *) addr;
} else {
- pmem->virt_addr = memremap_pmem(dev, pmem->phys_addr,
- pmem->size);
+ pmem->virt_addr = (void __pmem *) devm_memremap(dev,
+ pmem->phys_addr, pmem->size,
+ ARCH_MEMREMAP_PMEM);
if (!pmem->virt_addr)
return ERR_PTR(-ENXIO);
}
@@ -363,8 +364,8 @@ static int nvdimm_namespace_attach_pfn(struct nd_namespace_common *ndns)
/* establish pfn range for lookup, and switch to direct map */
pmem = dev_get_drvdata(dev);
- memunmap_pmem(dev, pmem->virt_addr);
- pmem->virt_addr = (void __pmem *)devm_memremap_pages(dev, &nsio->res);
+ devm_memunmap(dev, (void __force *) pmem->virt_addr);
+ pmem->virt_addr = (void __pmem *) devm_memremap_pages(dev, &nsio->res);
if (IS_ERR(pmem->virt_addr)) {
rc = PTR_ERR(pmem->virt_addr);
goto err;