Commit | Line | Data |
---|---|---|
8261d961 DB |
1 | /* |
2 | * Industrial I/O configfs bits | |
3 | * | |
4 | * Copyright (c) 2015 Intel Corporation | |
5 | * | |
6 | * This program is free software; you can redistribute it and/or modify it | |
7 | * under the terms of the GNU General Public License version 2 as published by | |
8 | * the Free Software Foundation. | |
9 | */ | |
10 | ||
11 | #include <linux/configfs.h> | |
12 | #include <linux/module.h> | |
13 | #include <linux/init.h> | |
14 | #include <linux/kmod.h> | |
15 | #include <linux/slab.h> | |
16 | ||
17 | #include <linux/iio/iio.h> | |
18 | ||
19 | static struct config_item_type iio_root_group_type = { | |
20 | .ct_owner = THIS_MODULE, | |
21 | }; | |
22 | ||
23 | struct configfs_subsystem iio_configfs_subsys = { | |
24 | .su_group = { | |
25 | .cg_item = { | |
26 | .ci_namebuf = "iio", | |
27 | .ci_type = &iio_root_group_type, | |
28 | }, | |
29 | }, | |
30 | .su_mutex = __MUTEX_INITIALIZER(iio_configfs_subsys.su_mutex), | |
31 | }; | |
32 | EXPORT_SYMBOL(iio_configfs_subsys); | |
33 | ||
34 | static int __init iio_configfs_init(void) | |
35 | { | |
36 | config_group_init(&iio_configfs_subsys.su_group); | |
37 | ||
38 | return configfs_register_subsystem(&iio_configfs_subsys); | |
39 | } | |
40 | module_init(iio_configfs_init); | |
41 | ||
42 | static void __exit iio_configfs_exit(void) | |
43 | { | |
44 | configfs_unregister_subsystem(&iio_configfs_subsys); | |
45 | } | |
46 | module_exit(iio_configfs_exit); | |
47 | ||
48 | MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com>"); | |
49 | MODULE_DESCRIPTION("Industrial I/O configfs support"); | |
50 | MODULE_LICENSE("GPL v2"); |