compat: backport net_ns_type_operations
[~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
40         printk(KERN_INFO
41                COMPAT_PROJECT " backport release: "
42                COMPAT_VERSION
43                "\n");
44         printk(KERN_INFO "Backport based on "
45                COMPAT_BASE_TREE " " COMPAT_BASE_TREE_VERSION
46                "\n");
47
48         return 0;
49 }
50 module_init(compat_init);
51
52 static void __exit compat_exit(void)
53 {
54         compat_pm_qos_power_deinit();
55
56         return;
57 }
58 module_exit(compat_exit);
59