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.
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;