forked from apriorit/SimpleLinuxDriver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.c
More file actions
28 lines (23 loc) · 945 Bytes
/
main.c
File metadata and controls
28 lines (23 loc) · 945 Bytes
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
#include "device_file.h"
#include <linux/init.h> /* module_init, module_exit */
#include <linux/module.h> /* version info, MODULE_LICENSE, MODULE_AUTHOR, printk() */
MODULE_DESCRIPTION("Simple Linux driver");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Apriorit, Inc");
/*===============================================================================================*/
static int simple_driver_init(void)
{
int result = 0;
printk( KERN_NOTICE "Simple-driver: Initialization started\n" );
result = register_device();
return result;
}
/*===============================================================================================*/
static void simple_driver_exit(void)
{
printk( KERN_NOTICE "Simple-driver: Exiting\n" );
unregister_device();
}
/*===============================================================================================*/
module_init(simple_driver_init);
module_exit(simple_driver_exit);