diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-03-12 20:08:57 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-04-27 17:57:28 (GMT) |
commit | 414264f959cf46f49f974b3510400e12ac3624a6 (patch) | |
tree | ead43994761620cbf7cb22525610627786562098 /drivers/base | |
parent | 621a1672f7377e08a942f205d6742d8af1292aab (diff) | |
download | linux-414264f959cf46f49f974b3510400e12ac3624a6.tar.xz |
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>
Diffstat (limited to 'drivers/base')
-rw-r--r-- | drivers/base/core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index bb2cc37..bffb69e 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -157,6 +157,11 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj, char **envp, "MINOR=%u", MINOR(dev->devt)); } + if (dev->type && dev->type->name) + add_uevent_var(envp, num_envp, &i, + buffer, buffer_size, &length, + "DEVTYPE=%s", dev->type->name); + if (dev->driver) add_uevent_var(envp, num_envp, &i, buffer, buffer_size, &length, |