From: Kay Sievers Date: Sat, 7 Oct 2006 19:54:55 +0000 (+0200) Subject: Driver core: allow to delay the uevent at device creation time X-Git-Tag: v2.6.21-rc2~42^2~10^2~2 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b7a3e813fb84624166f034e25234f98de5846bfc;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/core.c b/drivers/base/core.c index 34ac18778d8..e13614241c9 100644 --- a/drivers/base/core.c +++ b/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) diff --git a/include/linux/device.h b/include/linux/device.h index e1e164f81ee..5ca1cdba563 100644 --- a/include/linux/device.h +++ b/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); };