Files
rk35xx-android14/external/kmod/testsuite/module-playground/mod-simple.c
T
hmz007 36ed224bac Rockchip Anroid14_SDK 20240628-rkr5 (2556df1a)
Signed-off-by: hmz007 <hmz007@gmail.com>
Change-Id: Ib87fdbe7a0be7dc961af3500fe9ea4589a127f9f
2024-10-29 18:12:02 +08:00

33 lines
644 B
C

#include <linux/debugfs.h>
#include <linux/init.h>
#include <linux/module.h>
static struct dentry *debugfs_dir;
static int test_show(struct seq_file *s, void *data)
{
seq_puts(s, "test");
return 0;
}
DEFINE_SHOW_ATTRIBUTE(test);
static int __init test_module_init(void)
{
debugfs_dir = debugfs_create_dir(KBUILD_MODNAME, NULL);
debugfs_create_file("test", 0444, debugfs_dir, NULL, &test_fops);
return 0;
}
static void test_module_exit(void)
{
debugfs_remove_recursive(debugfs_dir);
}
module_init(test_module_init);
module_exit(test_module_exit);
MODULE_AUTHOR("Lucas De Marchi <lucas.demarchi@intel.com>");
MODULE_LICENSE("GPL");