-
Notifications
You must be signed in to change notification settings - Fork 1
/
cdata_plat_dev.c
48 lines (40 loc) · 937 Bytes
/
cdata_plat_dev.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
42
43
44
45
46
47
48
/*
* LDT - Linux Driver Template
*
* Copyright (C) 2012 Constantine Shulyupin http://www.makelinux.net/
*
* GPL License
*
* platform_device template driver
*
* uses
*
* platform_data
* resources
*
*/
#include <linux/module.h>
#include <linux/platform_device.h>
static struct resource ldt_resource[] = {
};
static void ldt_dev_release(struct device *dev)
{
}
static struct platform_device ldt_platform_device = {
.name = "cdata-device",
.resource = ldt_resource,
.num_resources = ARRAY_SIZE(ldt_resource),
};
static int ldt_plat_dev_init(void)
{
return platform_device_register(&ldt_platform_device);
}
static void ldt_plat_dev_exit(void)
{
platform_device_unregister(&ldt_platform_device);
}
module_init(ldt_plat_dev_init);
module_exit(ldt_plat_dev_exit);
MODULE_DESCRIPTION("LDT - Linux Driver Template: platform_device");
MODULE_AUTHOR("Constantine Shulyupin <[email protected]>");
MODULE_LICENSE("GPL");