mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
misc: Add attribute groups
Add groups field to struct miscdevice for passing the attribute groups at device creation. In this way, the driver can avoid the manual call of device_create_file() after the device registration, which is basically a racy operation, in addition to the reduction of manual device_remove_file() calls. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
2f9763190d
commit
bd73599530
2 changed files with 5 additions and 2 deletions
|
@ -52,6 +52,7 @@
|
|||
#define MISC_DYNAMIC_MINOR 255
|
||||
|
||||
struct device;
|
||||
struct attribute_group;
|
||||
|
||||
struct miscdevice {
|
||||
int minor;
|
||||
|
@ -60,6 +61,7 @@ struct miscdevice {
|
|||
struct list_head list;
|
||||
struct device *parent;
|
||||
struct device *this_device;
|
||||
const struct attribute_group **groups;
|
||||
const char *nodename;
|
||||
umode_t mode;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue