summaryrefslogtreecommitdiff
path: root/drivers/dax/pmem.c
diff options
context:
space:
mode:
authorDan Williams <dan.j.williams@intel.com>2016-07-20 00:51:40 (GMT)
committerDan Williams <dan.j.williams@intel.com>2016-10-07 23:45:59 (GMT)
commitd76911ee933a64c9dfc453e580e7ad612b394e83 (patch)
treedad6ced4a5968e946e2bec11b9e76b4518f199d9 /drivers/dax/pmem.c
parent9d2d01a031a945075d4609b1c4d3c73f10ba61e7 (diff)
downloadlinux-d76911ee933a64c9dfc453e580e7ad612b394e83.tar.xz
dax: convert devm_create_dax_dev to PTR_ERR
For sub-division support we need access to the dax_dev created by devm_create_dax_dev(). Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Diffstat (limited to 'drivers/dax/pmem.c')
-rw-r--r--drivers/dax/pmem.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/dax/pmem.c b/drivers/dax/pmem.c
index 59b75c5..c24d32e 100644
--- a/drivers/dax/pmem.c
+++ b/drivers/dax/pmem.c
@@ -61,6 +61,7 @@ static int dax_pmem_probe(struct device *dev)
int rc;
void *addr;
struct resource res;
+ struct dax_dev *dax_dev;
struct nd_pfn_sb *pfn_sb;
struct dax_pmem *dax_pmem;
struct nd_region *nd_region;
@@ -123,12 +124,12 @@ static int dax_pmem_probe(struct device *dev)
return -ENOMEM;
/* TODO: support for subdividing a dax region... */
- rc = devm_create_dax_dev(dax_region, &res, 1);
+ dax_dev = devm_create_dax_dev(dax_region, &res, 1);
/* child dax_dev instances now own the lifetime of the dax_region */
dax_region_put(dax_region);
- return rc;
+ return PTR_ERR_OR_ZERO(dax_dev);
}
static struct nd_device_driver dax_pmem_driver = {