industrialio-configfs.c 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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. #include <linux/configfs.h>
  11. #include <linux/module.h>
  12. #include <linux/init.h>
  13. #include <linux/kmod.h>
  14. #include <linux/slab.h>
  15. #include <linux/iio/iio.h>
  16. #include <linux/iio/configfs.h>
  17. static const struct config_item_type iio_root_group_type = {
  18. .ct_owner = THIS_MODULE,
  19. };
  20. struct configfs_subsystem iio_configfs_subsys = {
  21. .su_group = {
  22. .cg_item = {
  23. .ci_namebuf = "iio",
  24. .ci_type = &iio_root_group_type,
  25. },
  26. },
  27. .su_mutex = __MUTEX_INITIALIZER(iio_configfs_subsys.su_mutex),
  28. };
  29. EXPORT_SYMBOL(iio_configfs_subsys);
  30. static int __init iio_configfs_init(void)
  31. {
  32. config_group_init(&iio_configfs_subsys.su_group);
  33. return configfs_register_subsystem(&iio_configfs_subsys);
  34. }
  35. module_init(iio_configfs_init);
  36. static void __exit iio_configfs_exit(void)
  37. {
  38. configfs_unregister_subsystem(&iio_configfs_subsys);
  39. }
  40. module_exit(iio_configfs_exit);
  41. MODULE_AUTHOR("Daniel Baluta <daniel.baluta@intel.com>");
  42. MODULE_DESCRIPTION("Industrial I/O configfs support");
  43. MODULE_LICENSE("GPL v2");