summaryrefslogtreecommitdiff
path: root/drivers/nvdimm/region.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/nvdimm/region.c')
-rw-r--r--drivers/nvdimm/region.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/nvdimm/region.c b/drivers/nvdimm/region.c
index 9aba44e483e0..2a5f3f53d79d 100644
--- a/drivers/nvdimm/region.c
+++ b/drivers/nvdimm/region.c
@@ -33,12 +33,13 @@ static int nd_region_probe(struct device *dev)
num_ns->count = rc + err;
dev_set_drvdata(dev, num_ns);
+ if (rc && err && rc == err)
+ return -ENODEV;
+
+ nd_region->btt_seed = nd_btt_create(nd_region);
if (err == 0)
return 0;
- if (rc == err)
- return -ENODEV;
-
/*
* Given multiple namespaces per region, we do not want to
* disable all the successfully registered peer namespaces upon
@@ -66,6 +67,7 @@ static int nd_region_remove(struct device *dev)
/* flush attribute readers and disable */
nvdimm_bus_lock(dev);
nd_region->ns_seed = NULL;
+ nd_region->btt_seed = NULL;
dev_set_drvdata(dev, NULL);
nvdimm_bus_unlock(dev);