Skip to content

Commit 1295059

Browse files
Paul Gortmakergregkh
authored andcommitted
drivers/staging: make android ashmem.c explicitly non-modular
The Kconfig currently controlling compilation of this code is: drivers/staging/android/Kconfig:config ASHMEM drivers/staging/android/Kconfig: bool "Enable the Anonymous Shared Memory Subsystem" ...meaning that it currently is not being built as a module by anyone. Lets remove the modular code that is essentially orphaned, so that when reading the driver there is no doubt it is builtin-only. Since module_init translates to device_initcall in the non-modular case, the init ordering remains unchanged with this commit. We replace module.h with init.h and export.h ; the latter since this file uses the global THIS_MODULE. We also delete the MODULE_LICENSE tag etc. since all that information is already contained at the top of the file in the comments. Cc: "Arve Hjønnevåg" <arve@android.com> Cc: Riley Andrews <riandrews@android.com> Cc: devel@driverdev.osuosl.org Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 35890c2 commit 1295059

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

drivers/staging/android/ashmem.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818

1919
#define pr_fmt(fmt) "ashmem: " fmt
2020

21-
#include <linux/module.h>
21+
#include <linux/init.h>
22+
#include <linux/export.h>
2223
#include <linux/file.h>
2324
#include <linux/fs.h>
2425
#include <linux/falloc.h>
@@ -860,19 +861,4 @@ static int __init ashmem_init(void)
860861

861862
return 0;
862863
}
863-
864-
static void __exit ashmem_exit(void)
865-
{
866-
unregister_shrinker(&ashmem_shrinker);
867-
868-
misc_deregister(&ashmem_misc);
869-
kmem_cache_destroy(ashmem_range_cachep);
870-
kmem_cache_destroy(ashmem_area_cachep);
871-
872-
pr_info("unloaded\n");
873-
}
874-
875-
module_init(ashmem_init);
876-
module_exit(ashmem_exit);
877-
878-
MODULE_LICENSE("GPL");
864+
device_initcall(ashmem_init);

0 commit comments

Comments
 (0)