Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Driver core: allow to delay the uevent at device creation time

For the block subsystem, we want to delay all uevents until the
disk has been scanned and allpartitons are already created before
the first event is sent out.

Signed-off-by: Kay Sievers <kay.sievers@novell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Kay Sievers and committed by
Greg Kroah-Hartman
b7a3e813 f9f852df

+4 -2
+2 -1
drivers/base/core.c
··· 589 589 goto PMError; 590 590 if ((error = bus_add_device(dev))) 591 591 goto BusError; 592 - kobject_uevent(&dev->kobj, KOBJ_ADD); 592 + if (!dev->uevent_suppress) 593 + kobject_uevent(&dev->kobj, KOBJ_ADD); 593 594 if ((error = bus_attach_device(dev))) 594 595 goto AttachError; 595 596 if (parent)
+2 -1
include/linux/device.h
··· 399 399 400 400 /* class_device migration path */ 401 401 struct list_head node; 402 - struct class *class; /* optional*/ 402 + struct class *class; 403 403 dev_t devt; /* dev_t, creates the sysfs "dev" */ 404 404 struct attribute_group **groups; /* optional groups */ 405 + int uevent_suppress; 405 406 406 407 void (*release)(struct device * dev); 407 408 };