From kay.sievers@novell.com Sat Oct 7 13:11:34 2006 From: Kay Sievers Date: Sat, 07 Oct 2006 21:54:55 +0200 Subject: Driver core: allow to delay the uevent at device creation time Message-Id: <1160250895.4235.21.camel@localhost> 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 Signed-off-by: Greg Kroah-Hartman --- drivers/base/core.c | 3 ++- include/linux/device.h | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) --- gregkh-2.6.orig/drivers/base/core.c +++ gregkh-2.6/drivers/base/core.c @@ -589,7 +589,8 @@ int device_add(struct device *dev) goto PMError; if ((error = bus_add_device(dev))) goto BusError; - kobject_uevent(&dev->kobj, KOBJ_ADD); + if (!dev->uevent_suppress) + kobject_uevent(&dev->kobj, KOBJ_ADD); if ((error = bus_attach_device(dev))) goto AttachError; if (parent) --- gregkh-2.6.orig/include/linux/device.h +++ gregkh-2.6/include/linux/device.h @@ -399,9 +399,10 @@ struct device { /* class_device migration path */ struct list_head node; - struct class *class; /* optional*/ + struct class *class; dev_t devt; /* dev_t, creates the sysfs "dev" */ struct attribute_group **groups; /* optional groups */ + int uevent_suppress; void (*release)(struct device * dev); };