blob: 47900de1f10500bf8b3b20baed4f9381406036cd [file] [log] [blame]
Thomas Gleixnerd2912cb2019-06-04 10:11:33 +02001// SPDX-License-Identifier: GPL-2.0-only
Daniel Baluta8261d962015-11-09 09:13:59 +02002/*
3 * Industrial I/O configfs bits
4 *
5 * Copyright (c) 2015 Intel Corporation
Daniel Baluta8261d962015-11-09 09:13:59 +02006 */
7
8#include <linux/configfs.h>
9#include <linux/module.h>
10#include <linux/init.h>
11#include <linux/kmod.h>
12#include <linux/slab.h>
13
14#include <linux/iio/iio.h>
Jonathan Cameron8d6c16d2015-12-05 16:23:26 +000015#include <linux/iio/configfs.h>
Daniel Baluta8261d962015-11-09 09:13:59 +020016
Bhumika Goyal612a4622017-10-16 17:18:43 +020017static const struct config_item_type iio_root_group_type = {
Daniel Baluta8261d962015-11-09 09:13:59 +020018 .ct_owner = THIS_MODULE,
19};
20
21struct configfs_subsystem iio_configfs_subsys = {
22 .su_group = {
23 .cg_item = {
24 .ci_namebuf = "iio",
25 .ci_type = &iio_root_group_type,
26 },
27 },
28 .su_mutex = __MUTEX_INITIALIZER(iio_configfs_subsys.su_mutex),
29};
30EXPORT_SYMBOL(iio_configfs_subsys);
31
32static int __init iio_configfs_init(void)
33{
34 config_group_init(&iio_configfs_subsys.su_group);
35
36 return configfs_register_subsystem(&iio_configfs_subsys);
37}
38module_init(iio_configfs_init);
39
40static void __exit iio_configfs_exit(void)
41{
42 configfs_unregister_subsystem(&iio_configfs_subsys);
43}
44module_exit(iio_configfs_exit);
45
46MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com>");
47MODULE_DESCRIPTION("Industrial I/O configfs support");
48MODULE_LICENSE("GPL v2");