diff options
Diffstat (limited to 'drivers/nvdimm/region.c')
-rw-r--r-- | drivers/nvdimm/region.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/nvdimm/region.c b/drivers/nvdimm/region.c index eb8aebcd4800..f28f78ccff19 100644 --- a/drivers/nvdimm/region.c +++ b/drivers/nvdimm/region.c @@ -18,11 +18,10 @@ static int nd_region_probe(struct device *dev) { - int err; + int err, rc; static unsigned long once; struct nd_region_namespaces *num_ns; struct nd_region *nd_region = to_nd_region(dev); - int rc = nd_region_register_namespaces(nd_region, &err); if (nd_region->num_lanes > num_online_cpus() && nd_region->num_lanes < num_possible_cpus() @@ -34,6 +33,11 @@ static int nd_region_probe(struct device *dev) nd_region->num_lanes); } + rc = nd_blk_region_init(nd_region); + if (rc) + return rc; + + rc = nd_region_register_namespaces(nd_region, &err); num_ns = devm_kzalloc(dev, sizeof(*num_ns), GFP_KERNEL); if (!num_ns) return -ENOMEM; |