leds: wm831x-status: fix use-after-free on unbind
[linux/fpc-iii.git] / drivers / iio / industrialio-configfs.c
blob47900de1f10500bf8b3b20baed4f9381406036cd
1 // SPDX-License-Identifier: GPL-2.0-only
2 /*
3 * Industrial I/O configfs bits
5 * Copyright (c) 2015 Intel Corporation
6 */
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>
14 #include <linux/iio/iio.h>
15 #include <linux/iio/configfs.h>
17 static const struct config_item_type iio_root_group_type = {
18 .ct_owner = THIS_MODULE,
21 struct configfs_subsystem iio_configfs_subsys = {
22 .su_group = {
23 .cg_item = {
24 .ci_namebuf = "iio",
25 .ci_type = &iio_root_group_type,
28 .su_mutex = __MUTEX_INITIALIZER(iio_configfs_subsys.su_mutex),
30 EXPORT_SYMBOL(iio_configfs_subsys);
32 static int __init iio_configfs_init(void)
34 config_group_init(&iio_configfs_subsys.su_group);
36 return configfs_register_subsystem(&iio_configfs_subsys);
38 module_init(iio_configfs_init);
40 static void __exit iio_configfs_exit(void)
42 configfs_unregister_subsystem(&iio_configfs_subsys);
44 module_exit(iio_configfs_exit);
46 MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com>");
47 MODULE_DESCRIPTION("Industrial I/O configfs support");
48 MODULE_LICENSE("GPL v2");