What's the difference between sysfs_create_file() and sysfs_create_group()?
linux, linux-device-driver, linux-kernel
Solution
Yes, the group is just a helper wrapper that makes it easier to manage multiple attributes. You can read about them in section 9 of this pdf.
Problem
The two functions' prototypes: ``` int sysfs_create_group(struct kobject *kobj, const struct attribute_group *grp) int sysfs_create_file(struct kobject * kobj, const struct attribute * attr) ``` It seems to me that these two functions will both create attributes under the `kobj->name` directory in `sysfs`. The only difference I can find is, the group func can create a group of attributes in one time as the file func only one attribute. So are there other deferences? Or is my understanding of the functions wrong?