mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-05 05:42:36 +00:00
Driver core: add name to device_type
If "name" of a device_type is specified, the uevent will contain the device_type name in the DEVTYPE variable. This helps userspace to distingiush between different types of devices, belonging to the same subsystem. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
621a1672f7
commit
414264f959
2 changed files with 15 additions and 0 deletions
|
@ -331,7 +331,17 @@ extern struct class_device *class_device_create(struct class *cls,
|
|||
__attribute__((format(printf,5,6)));
|
||||
extern void class_device_destroy(struct class *cls, dev_t devt);
|
||||
|
||||
/*
|
||||
* The type of device, "struct device" is embedded in. A class
|
||||
* or bus can contain devices of different types
|
||||
* like "partitions" and "disks", "mouse" and "event".
|
||||
* This identifies the device type and carries type-specific
|
||||
* information, equivalent to the kobj_type of a kobject.
|
||||
* If "name" is specified, the uevent will contain it in
|
||||
* the DEVTYPE variable.
|
||||
*/
|
||||
struct device_type {
|
||||
const char *name;
|
||||
struct attribute_group **groups;
|
||||
int (*uevent)(struct device *dev, char **envp, int num_envp,
|
||||
char *buffer, int buffer_size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue