@@ -546,7 +546,7 @@ int __nd_driver_register(struct nd_device_driver *nd_drv, struct module *owner,
{
struct device_driver *drv = &nd_drv->drv;
- if (!nd_drv->type) {
+ if (!(nd_drv->type & ND_DRIVER_FLAGS_MASK)) {
pr_debug("driver type bitmask not set (%pf)\n",
__builtin_return_address(0));
return -EINVAL;
@@ -207,6 +207,8 @@ enum nd_driver_flags {
ND_DRIVER_NAMESPACE_BLK = 1 << ND_DEVICE_NAMESPACE_BLK,
ND_DRIVER_DAX_PMEM = 1 << ND_DEVICE_DAX_PMEM,
};
+#define ND_DRIVER_FLAGS_MAX ND_DRIVER_DAX_PMEM
+#define ND_DRIVER_FLAGS_MASK (((ND_DRIVER_FLAGS_MAX) << 1) - 2)
enum {
ND_MIN_NAMESPACE_SIZE = PAGE_SIZE,