Driver core: allow to delay the uevent at device creation time
authorKay Sievers <kay.sievers@novell.com>
Sat, 7 Oct 2006 19:54:55 +0000 (21:54 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 7 Feb 2007 18:37:14 +0000 (10:37 -0800)
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>
drivers/base/core.c
include/linux/device.h

index 34ac18778d8a30173a2eecef077cd04c819527c3..e13614241c9eeed951141d285bb5d8e041ded23c 100644 (file)
@@ -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)
index e1e164f81eea3b5168d2310cb66deafb20fc9d08..5ca1cdba563a43b4bc05cbe99b313203822add6b 100644 (file)
@@ -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);
 };