aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/miscdevice.h
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2015-02-02 09:44:54 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-03-25 06:44:52 -0400
commitbd735995308b553cc3c7f6a975aa284b270c7e2c (patch)
tree599cbb2f030ab78d8a136b7f00fd16bda2e2f799 /include/linux/miscdevice.h
parent2f9763190dd6356eec95548f4cfa8a36a71f767c (diff)
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>
Diffstat (limited to 'include/linux/miscdevice.h')
-rw-r--r--include/linux/miscdevice.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index ee80dd7d9f60..819077c32690 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -52,6 +52,7 @@
52#define MISC_DYNAMIC_MINOR 255 52#define MISC_DYNAMIC_MINOR 255
53 53
54struct device; 54struct device;
55struct attribute_group;
55 56
56struct miscdevice { 57struct miscdevice {
57 int minor; 58 int minor;
@@ -60,6 +61,7 @@ struct miscdevice {
60 struct list_head list; 61 struct list_head list;
61 struct device *parent; 62 struct device *parent;
62 struct device *this_device; 63 struct device *this_device;
64 const struct attribute_group **groups;
63 const char *nodename; 65 const char *nodename;
64 umode_t mode; 66 umode_t mode;
65}; 67};