In Linux kernel, given a module how can I know is it's kobject?
Context: I am trying to do a sysfs_create_file(kobj,attr) in a kernel module. I have all the attribute stuff set up, but I want to add an attribute to the current module.
ok after looking through module.h I found it.
struct kobject mod_kobj = (((struct module *)(THIS_MODULE))->mkobj).kobj;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With