File: module.h

package info (click to toggle)
comedi 0.7.76%2B20080817cvs-1
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 7,660 kB
  • ctags: 14,259
  • sloc: ansic: 104,304; sh: 1,417; makefile: 625; perl: 457
file content (49 lines) | stat: -rw-r--r-- 944 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*
 * module.h compatibility header
 */

#ifndef _COMPAT_MODULE_H
#define _COMPAT_MODULE_H

#include <linux/version.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,10)
#define MODULE_LICENSE(x)
#endif

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,11)
#define EXPORT_SYMBOL_GPL(x) EXPORT_SYMBOL(x)
#endif

#include_next <linux/module.h>

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,48)
static inline int try_module_get(struct module *module)
{
	if (!module)
		return 1;
	__MOD_INC_USE_COUNT(module);
	return 1;
}
static inline void module_put(struct module *module)
{
	if (!module)
		return;
	__MOD_DEC_USE_COUNT(module);
}
#endif
#if LINUX_VERSION_CODE < KERNEL_VERSION(2,5,69)
static inline void __module_get(struct module *module)
{
	(void)try_module_get(module);
}
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,59)
#define MOD_IN_USE (0)
#endif

#ifndef module_param
#include <linux/moduleparam.h>
#endif

#endif /* _COMPAT_MODULE_H */