[CLASS DEVICE]: add attribute_group creation
Extend the support of attribute groups in class_device's to allow groups to be created as part of the registration process. This allows network device's to avoid race between registration and creating groups. Note that unlike attributes that are a property of the class object, the groups are a property of the class_device object. This is done because there are different types of network devices (wireless for example). Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
5528e568a7
commit
1498221d51
@ -200,6 +200,7 @@ extern int class_device_create_file(struct class_device *,
|
||||
* @node: for internal use by the driver core only.
|
||||
* @kobj: for internal use by the driver core only.
|
||||
* @devt_attr: for internal use by the driver core only.
|
||||
* @groups: optional additional groups to be created
|
||||
* @dev: if set, a symlink to the struct device is created in the sysfs
|
||||
* directory for this struct class device.
|
||||
* @class_data: pointer to whatever you want to store here for this struct
|
||||
@ -228,6 +229,7 @@ struct class_device {
|
||||
struct device * dev; /* not necessary, but nice to have */
|
||||
void * class_data; /* class-specific data */
|
||||
struct class_device *parent; /* parent of this child device, if there is one */
|
||||
struct attribute_group ** groups; /* optional groups */
|
||||
|
||||
void (*release)(struct class_device *dev);
|
||||
int (*uevent)(struct class_device *dev, char **envp,
|
||||
|
Reference in New Issue
Block a user