summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/base/core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 6fbdd8bb8a3d..aa939807047b 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1273,6 +1273,7 @@ struct device *__root_device_register(const char *name, struct module *owner)
return ERR_PTR(err);
}
+#ifdef CONFIG_MODULE
if (owner) {
struct module_kobject *mk = &owner->mkobj;
@@ -1283,6 +1284,7 @@ struct device *__root_device_register(const char *name, struct module *owner)
}
root->owner = owner;
}
+#endif
return &root->dev;
}