Merge tag 'devdax-for-5.1' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm...
[muen/linux.git] / drivers / nvdimm / region_devs.c
index caf2f31..b4ef7d9 100644 (file)
@@ -1003,6 +1003,13 @@ static struct nd_region *nd_region_create(struct nvdimm_bus *nvdimm_bus,
 
                if (test_bit(NDD_UNARMED, &nvdimm->flags))
                        ro = 1;
+
+               if (test_bit(NDD_NOBLK, &nvdimm->flags)
+                               && dev_type == &nd_blk_device_type) {
+                       dev_err(&nvdimm_bus->dev, "%s: %s mapping%d is not BLK capable\n",
+                                       caller, dev_name(&nvdimm->dev), i);
+                       return NULL;
+               }
        }
 
        if (dev_type == &nd_blk_device_type) {