Skip to content

Commit

Permalink
Driver core: allow to delay the uevent at device creation time
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
Kay Sievers authored and gregkh committed Feb 7, 2007
1 parent f9f852d commit b7a3e81
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion drivers/base/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 2 additions & 1 deletion include/linux/device.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit b7a3e81

Please sign in to comment.