Commit 276df1b2 authored by Linus Torvalds's avatar Linus Torvalds

Make cdev infrastructure initialize early

Very early initialization (core_initcall) needs to have the cdev
initialization done.  So make it part of the pre-initcall sequence, the
same way the bdev caches were done.
parent 48554ca4
...@@ -457,11 +457,9 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data) ...@@ -457,11 +457,9 @@ static struct kobject *base_probe(dev_t dev, int *part, void *data)
return NULL; return NULL;
} }
static int __init chrdev_init(void) void __init chrdev_init(void)
{ {
subsystem_register(&cdev_subsys); subsystem_register(&cdev_subsys);
kset_register(&kset_dynamic); kset_register(&kset_dynamic);
cdev_map = kobj_map_init(base_probe, &cdev_subsys); cdev_map = kobj_map_init(base_probe, &cdev_subsys);
return 0;
} }
subsys_initcall(chrdev_init);
...@@ -1606,6 +1606,7 @@ kmem_cache_t *filp_cachep; ...@@ -1606,6 +1606,7 @@ kmem_cache_t *filp_cachep;
EXPORT_SYMBOL(d_genocide); EXPORT_SYMBOL(d_genocide);
extern void bdev_cache_init(void); extern void bdev_cache_init(void);
extern void chrdev_init(void);
void __init vfs_caches_init(unsigned long mempages) void __init vfs_caches_init(unsigned long mempages)
{ {
...@@ -1626,4 +1627,5 @@ void __init vfs_caches_init(unsigned long mempages) ...@@ -1626,4 +1627,5 @@ void __init vfs_caches_init(unsigned long mempages)
files_init(mempages); files_init(mempages);
mnt_init(mempages); mnt_init(mempages);
bdev_cache_init(); bdev_cache_init();
chrdev_init();
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment