diff options
author | Dan Williams <dan.j.williams@intel.com> | 2016-03-11 10:15:36 -0800 |
---|---|---|
committer | Dan Williams <dan.j.williams@intel.com> | 2016-05-09 15:35:42 -0700 |
commit | cd03412a51ac4cb3001a8cdfae4560c9602f3387 (patch) | |
tree | c2d501759d7d96fab9a0f70eefba139876bb12de /drivers/nvdimm/bus.c | |
parent | 0bfb8dd3edd6e423b5053c86e10c97e92cf205ea (diff) | |
download | linux-cd03412a51ac4cb3001a8cdfae4560c9602f3387.tar.bz2 |
libnvdimm, dax: introduce device-dax infrastructure
Device DAX is the device-centric analogue of Filesystem DAX
(CONFIG_FS_DAX). It allows persistent memory ranges to be allocated and
mapped without need of an intervening file system. This initial
infrastructure arranges for a libnvdimm pfn-device to be represented as
a different device-type so that it can be attached to a driver other
than the pmem driver.
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/nvdimm/bus.c')
-rw-r--r-- | drivers/nvdimm/bus.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/nvdimm/bus.c b/drivers/nvdimm/bus.c index 19f822d7f652..97589e3cb852 100644 --- a/drivers/nvdimm/bus.c +++ b/drivers/nvdimm/bus.c @@ -40,6 +40,8 @@ static int to_nd_device_type(struct device *dev) return ND_DEVICE_REGION_PMEM; else if (is_nd_blk(dev)) return ND_DEVICE_REGION_BLK; + else if (is_nd_dax(dev)) + return ND_DEVICE_DAX_PMEM; else if (is_nd_pmem(dev->parent) || is_nd_blk(dev->parent)) return nd_region_to_nstype(to_nd_region(dev->parent)); @@ -246,6 +248,8 @@ static void nd_async_device_unregister(void *d, async_cookie_t cookie) void __nd_device_register(struct device *dev) { + if (!dev) + return; dev->bus = &nvdimm_bus_type; get_device(dev); async_schedule_domain(nd_async_device_register, dev, |