I need to create a whole bunch of attributes for a driver, which makes it impractical to allocate them statically (64 directories with 5 attributes each).
It looks like there are multiple ways to create directories in sysfs. One seems to be sysfs_create_dir_ns()
and the other seems to be creating struct kobject
s, add them to the sysfs and then add attributes to them.
Is there a recommended (or "best") way to do this?