mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 10:57:46 +00:00
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>
This commit is contained in:
parent
ca2f37dbc5
commit
83b5fb4cce
1 changed files with 3 additions and 2 deletions
|
@ -120,6 +120,8 @@ static int dev_uevent_filter(struct kset *kset, struct kobject *kobj)
|
||||||
|
|
||||||
if (ktype == &ktype_device) {
|
if (ktype == &ktype_device) {
|
||||||
struct device *dev = to_dev(kobj);
|
struct device *dev = to_dev(kobj);
|
||||||
|
if (dev->uevent_suppress)
|
||||||
|
return 0;
|
||||||
if (dev->bus)
|
if (dev->bus)
|
||||||
return 1;
|
return 1;
|
||||||
if (dev->class)
|
if (dev->class)
|
||||||
|
@ -675,8 +677,7 @@ int device_add(struct device *dev)
|
||||||
goto PMError;
|
goto PMError;
|
||||||
if ((error = bus_add_device(dev)))
|
if ((error = bus_add_device(dev)))
|
||||||
goto BusError;
|
goto BusError;
|
||||||
if (!dev->uevent_suppress)
|
kobject_uevent(&dev->kobj, KOBJ_ADD);
|
||||||
kobject_uevent(&dev->kobj, KOBJ_ADD);
|
|
||||||
bus_attach_device(dev);
|
bus_attach_device(dev);
|
||||||
if (parent)
|
if (parent)
|
||||||
klist_add_tail(&dev->knode_parent, &parent->klist_children);
|
klist_add_tail(&dev->knode_parent, &parent->klist_children);
|
||||||
|
|
Loading…
Reference in a new issue