I need to find the kobject of my driver's sysfs directory
Hello,
I am developing a miscelaneous driver for Linu Kernel 4.9.80.
I want my driver to write some information in a file inside its sysfs directory (i.e. /sys/module/mydriversFolder/SomeFileWithInformaiton).
When I load my driver, if I go to the sys/modules/ directory, I can see there is already a directory for my driver which contains some folders and files (i.e. coresize, holders, initsize, initstate, etc.).
How can I get the kobject of this directory (the one that correspond to my drivers, inside /sys/module), so I can put a reference of it in another kboject's "parent" element?
I am trying to create a directory inside /sys/module/MyDriversFolder/.
Is this the correct approach?
Is there another -more correct/proper- way of doing this?
Thanks in advance!
|