aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/base/core.c
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2007-03-29 05:12:11 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2007-04-27 13:57:29 -0400
commit83b5fb4cce13b9f7b218ed88ee05387c3f3bdda3 (patch)
tree5b949c6fd72329ff395743dc3c36cac0f48efc87 /drivers/base/core.c
parentca2f37dbc5324c7278577731033a358f1f86050a (diff)
Driver core: suppress uevents via filter
Suppress uevents for devices if uevent_suppress is set via dev_uevent_filter(). This makes the driver core suppress all device uevents, not just the add event in device_add(). Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/base/core.c')
-rw-r--r--drivers/base/core.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index be6aeb430798..c34a4d8842e1 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -120,6 +120,8 @@ static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
120 120
121 if (ktype == &ktype_device) { 121 if (ktype == &ktype_device) {
122 struct device *dev = to_dev(kobj); 122 struct device *dev = to_dev(kobj);
123 if (dev->uevent_suppress)
124 return 0;
123 if (dev->bus) 125 if (dev->bus)
124 return 1; 126 return 1;
125 if (dev->class) 127 if (dev->class)
@@ -675,8 +677,7 @@ int device_add(struct device *dev)
675 goto PMError; 677 goto PMError;
676 if ((error = bus_add_device(dev))) 678 if ((error = bus_add_device(dev)))
677 goto BusError; 679 goto BusError;
678 if (!dev->uevent_suppress) 680 kobject_uevent(&dev->kobj, KOBJ_ADD);
679 kobject_uevent(&dev->kobj, KOBJ_ADD);
680 bus_attach_device(dev); 681 bus_attach_device(dev);
681 if (parent) 682 if (parent)
682 klist_add_tail(&dev->knode_parent, &parent->klist_children); 683 klist_add_tail(&dev->knode_parent, &parent->klist_children);