Make ashmem driver loadable as kernel module
This commit is contained in:
parent
34e5e70926
commit
acafc66bdf
1 changed files with 16 additions and 3 deletions
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
#define pr_fmt(fmt) "ashmem: " fmt
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/export.h>
|
||||
#include <linux/file.h>
|
||||
|
|
@ -857,8 +858,20 @@ static int __init ashmem_init(void)
|
|||
|
||||
register_shrinker(&ashmem_shrinker);
|
||||
|
||||
pr_info("initialized\n");
|
||||
|
||||
return 0;
|
||||
}
|
||||
device_initcall(ashmem_init);
|
||||
|
||||
static void __exit ashmem_exit(void)
|
||||
{
|
||||
unregister_shrinker(&ashmem_shrinker);
|
||||
|
||||
misc_deregister(&ashmem_misc);
|
||||
|
||||
kmem_cache_destroy(ashmem_range_cachep);
|
||||
kmem_cache_destroy(ashmem_area_cachep);
|
||||
}
|
||||
|
||||
module_init(ashmem_init);
|
||||
module_exit(ashmem_exit);
|
||||
|
||||
MODULE_LICENSE("GPL");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue