compat: backport system_nrt_wq
[~emulex/for-vlad/old/compat.git] / compat / main.c
1 #include <linux/module.h>
2
3 MODULE_AUTHOR("Luis R. Rodriguez");
4 MODULE_DESCRIPTION("Kernel compatibility module");
5 MODULE_LICENSE("GPL");
6
7 #ifndef COMPAT_BASE_TREE
8 #error "You need a COMPAT_BASE_TREE"
9 #endif
10
11 #ifndef COMPAT_BASE_TREE_VERSION
12 #error "You need a COMPAT_BASE_TREE_VERSION"
13 #endif
14
15 #ifndef COMPAT_VERSION
16 #error "You need a COMPAT_VERSION"
17 #endif
18
19 static char *compat_base_tree = COMPAT_BASE_TREE;
20 static char *compat_base_tree_version = COMPAT_BASE_TREE_VERSION;
21 static char *compat_version = COMPAT_VERSION;
22
23 module_param(compat_base_tree, charp, 0400);
24 MODULE_PARM_DESC(compat_base_tree,
25                  "The upstream tree used as base for this backport");
26
27 module_param(compat_base_tree_version, charp, 0400);
28 MODULE_PARM_DESC(compat_base_tree_version,
29                  "The git-describe of the upstream base tree");
30
31 module_param(compat_version, charp, 0400);
32 MODULE_PARM_DESC(compat_version,
33                  "Version of the kernel compat backport work");
34
35 static int __init compat_init(void)
36 {
37         /* pm-qos for kernels <= 2.6.24, this is a no-op on newer kernels */
38         compat_pm_qos_power_init();
39         compat_system_workqueue_create();
40
41         printk(KERN_INFO
42                COMPAT_PROJECT " backport release: "
43                COMPAT_VERSION
44                "\n");
45         printk(KERN_INFO "Backport based on "
46                COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
47                "\n");
48
49         return 0;
50 }
51 module_init(compat_init);
52
53 static void __exit compat_exit(void)
54 {
55         compat_pm_qos_power_deinit();
56         compat_system_workqueue_destroy();
57
58         return;
59 }
60 module_exit(compat_exit);
61