*/
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+
#include <linux/module.h>
#include <linux/debugfs.h>
#include <linux/uaccess.h>
char buf[32];
size_t buf_size;
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 7, 0) && LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0)
+ /*
+ * Global rcu-lock(debugfs_srcu) was added to debugfs
+ * in commit to linux-kernel:9fd4dcece43.
+ * It causes deadlock in debugfs_remove_recursive().
+ */
+ pr_err("This kernel version does not supported\n");
+ return -EPERM;
+#endif
+
buf_size = min(count, (sizeof(buf) - 1));
if (copy_from_user(buf, user_buf, buf_size))
return -EFAULT;