summaryrefslogtreecommitdiff
path: root/drivers/dax/bus.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2018-10-29 15:52:42 -0700
committerDan Williams <dan.j.williams@intel.com>2019-01-06 21:26:21 -0800
commit89ec9f2cfa36cc5fca2fb445ed221bb9add7b536 (patch)
tree1306755d2ecae784ddee3df710c16c4cfeaff771 /drivers/dax/bus.c
parent9567da0b408a2553d32ca83cba4f1fc5a8aad459 (diff)
downloadlwn-89ec9f2cfa36cc5fca2fb445ed221bb9add7b536.tar.gz
lwn-89ec9f2cfa36cc5fca2fb445ed221bb9add7b536.zip
device-dax: Move resource pinning+mapping into the common driver
Move the responsibility of calling devm_request_resource() and devm_memremap_pages() into the common device-dax driver. This is another preparatory step to allowing an alternate personality driver for a device-dax range. Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax/bus.c')
-rw-r--r--drivers/dax/bus.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 0cff32102c4c..69aae2cbd45f 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0
/* Copyright(c) 2017-2018 Intel Corporation. All rights reserved. */
+#include <linux/memremap.h>
#include <linux/device.h>
#include <linux/slab.h>
#include <linux/dax.h>
@@ -206,7 +207,8 @@ static void unregister_dev_dax(void *dev)
put_device(dev);
}
-struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region, int id)
+struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region, int id,
+ struct dev_pagemap *pgmap)
{
struct device *parent = dax_region->dev;
struct dax_device *dax_dev;
@@ -222,6 +224,8 @@ struct dev_dax *devm_create_dev_dax(struct dax_region *dax_region, int id)
if (!dev_dax)
return ERR_PTR(-ENOMEM);
+ memcpy(&dev_dax->pgmap, pgmap, sizeof(*pgmap));
+
/*
* No 'host' or dax_operations since there is no access to this
* device outside of mmap of the resulting character device.