是否有调用开发路径的子文件夹的多功能?

Is there a multi function that call child folder of a dev path?

如何在内核驱动中实现这个例子? 我查看了 'cdev'。但是,对于使用此示例结构的此函数,结果并不令人信服。

例如:

dev/test/on // this function is change status in test module

dev/test/changed "hello" // this function is change char value

我看了 "cdev" 和一些 github。但是,它是“/dev/test”一个文件。

我找到了"sysfs"!使用这个库我可以实现这个例子。

https://www.kernel.org/doc/Documentation/filesystems/sysfs.txt