diff options
| author | Robert Love <rml@novell.com> | 2004-12-14 18:48:19 -0800 |
|---|---|---|
| committer | Greg Kroah-Hartman <greg@kroah.com> | 2004-12-14 18:48:19 -0800 |
| commit | e2009eeeb6bc9ff58e35cfddc49b8019cca8ad58 (patch) | |
| tree | 0d3b0e3860600bb4f3adde3e94c3301086ba4055 /include/linux/miscdevice.h | |
| parent | 6805ca0350dfee156b43f810b57c2780e2a6b0ea (diff) | |
[PATCH] add class_device to miscdevice
Currently misc_register() throws away the return from
class_simple_device_add(). This makes it impossible to get to the
class_device of the directories in /sys/class/misc and, for example,
thus impossible to add attributes to those directories.
Attached patch adds a class_device structure to the miscdevice structure
and assigns to it the value returned from class_simple_device_add() in
misc_register(), thus caching the value and allowing us to f.e. later
call class_device_create_file().
We need this for inotify, but I can see plenty of other misc. devices
wanting this and consider it missing but required functionality.
Add the class_device structure to miscdevice so that we can add sysfs
attributes to /sys/class/misc/foo
Signed-Off-By: Robert Love <rml@novell.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
Diffstat (limited to 'include/linux/miscdevice.h')
| -rw-r--r-- | include/linux/miscdevice.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index 209f6ffbd588..56fe7347f921 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h @@ -2,6 +2,7 @@ #define _LINUX_MISCDEVICE_H #include <linux/module.h> #include <linux/major.h> +#include <linux/device.h> #define PSMOUSE_MINOR 1 #define MS_BUSMOUSE_MINOR 2 @@ -32,13 +33,13 @@ struct device; -struct miscdevice -{ +struct miscdevice { int minor; const char *name; struct file_operations *fops; struct list_head list; struct device *dev; + struct class_device *class; char devfs_name[64]; }; |
