30a4a1ee6e071a592aa99918ed9247822933ba6e
[~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 void compat_dependency_symbol(void)
36 {
37 }
38 EXPORT_SYMBOL_GPL(compat_dependency_symbol);
39
40 static int __init compat_init(void)
41 {
42         /* pm-qos for kernels <= 2.6.24, this is a no-op on newer kernels */
43         compat_pm_qos_power_init();
44         compat_system_workqueue_create();
45
46         printk(KERN_INFO
47                COMPAT_PROJECT " backport release: "
48                COMPAT_VERSION
49                "\n");
50         printk(KERN_INFO "Backport based on "
51                COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
52                "\n");
53
54         return 0;
55 }
56 module_init(compat_init);
57
58 static void __exit compat_exit(void)
59 {
60         compat_pm_qos_power_deinit();
61         compat_system_workqueue_destroy();
62
63         return;
64 }
65 module_exit(compat_exit);
66