-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.c
41 lines (32 loc) · 812 Bytes
/
main.c
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
/*
* omap-test.c - OMAP Test module
*/
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_INFO */
#include <linux/debugfs.h>
extern int omap_test_timer_init(struct dentry *d);
extern void omap_test_timer_exit(void);
static struct dentry *d;
int init_module(void)
{
int r;
d = debugfs_create_dir("omap-test", NULL);
if (IS_ERR_OR_NULL(d)) {
pr_err("OMAP Test: Failed to create omap-test directory!\n");
return PTR_ERR(d);
}
r = omap_test_timer_init(d);
if (r) {
pr_err("OMAP Test: Failed to initialise timer tests!\n");
return r;
}
pr_info("OMAP Test Module Loaded!\n");
return 0;
}
void cleanup_module(void)
{
omap_test_timer_exit();
debugfs_remove_recursive(d);
pr_info("OMAP Test Module Unloaded!\n");
}
MODULE_LICENSE("GPL v2");