diff options
-rw-r--r-- | drivers/base/core.c | 5 | ||||
-rw-r--r-- | include/linux/device.h | 10 |
2 files changed, 15 insertions, 0 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c index bb2cc37a4d43..bffb69e4bde2 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, | |||
157 | "MINOR=%u", MINOR(dev->devt)); | 157 | "MINOR=%u", MINOR(dev->devt)); |
158 | } | 158 | } |
159 | 159 | ||
160 | if (dev->type && dev->type->name) | ||
161 | add_uevent_var(envp, num_envp, &i, | ||
162 | buffer, buffer_size, &length, | ||
163 | "DEVTYPE=%s", dev->type->name); | ||
164 | |||
160 | if (dev->driver) | 165 | if (dev->driver) |
161 | add_uevent_var(envp, num_envp, &i, | 166 | add_uevent_var(envp, num_envp, &i, |
162 | buffer, buffer_size, &length, | 167 | buffer, buffer_size, &length, |
diff --git a/include/linux/device.h b/include/linux/device.h index 3b64fdecd041..7f63d4de5c4d 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -331,7 +331,17 @@ extern struct class_device *class_device_create(struct class *cls, | |||
331 | __attribute__((format(printf,5,6))); | 331 | __attribute__((format(printf,5,6))); |
332 | extern void class_device_destroy(struct class *cls, dev_t devt); | 332 | extern void class_device_destroy(struct class *cls, dev_t devt); |
333 | 333 | ||
334 | /* | ||
335 | * The type of device, "struct device" is embedded in. A class | ||
336 | * or bus can contain devices of different types | ||
337 | * like "partitions" and "disks", "mouse" and "event". | ||
338 | * This identifies the device type and carries type-specific | ||
339 | * information, equivalent to the kobj_type of a kobject. | ||
340 | * If "name" is specified, the uevent will contain it in | ||
341 | * the DEVTYPE variable. | ||
342 | */ | ||
334 | struct device_type { | 343 | struct device_type { |
344 | const char *name; | ||
335 | struct attribute_group **groups; | 345 | struct attribute_group **groups; |
336 | int (*uevent)(struct device *dev, char **envp, int num_envp, | 346 | int (*uevent)(struct device *dev, char **envp, int num_envp, |
337 | char *buffer, int buffer_size); | 347 | char *buffer, int buffer_size); |