blob: 7118aeb022cfbbca6bbab55d938561f7cdeff806 (
plain)
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
|
#include <linux/module.h>
#include <linux/device.h>
#include <linux/string.h>
/* cembus bus version */
unsigned int bversion = 1;
int cembus_match(struct device *dev, struct device_driver *drv)
{
printk("cembus: Checking for device and driver compatibility...\n");
printk("bus_id: %s - driver: %s\n", "foo", drv->name);
return 0;
}
int cembus_uevent(struct device *dev, struct kobj_uevent_env *env)
{
if (add_uevent_var(env, "CEMBUS_VERSION=%u", bversion));
return -ENOMEM;
return 0;
}
struct bus_type cem_bus_type = {
.name = "cembus",
.match = cembus_match,
.uevent = cembus_uevent,
};
static int __init cembus_init(void)
{
int ret = 0;
ret = bus_register(&cem_bus_type);
if (ret)
return ret;
return 0;
}
static void cembus_exit(void)
{
bus_unregister(&cem_bus_type);
}
MODULE_DESCRIPTION("cem virtual bus");
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Carlos Maiolino");
module_init(cembus_init);
module_exit(cembus_exit);
|