diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2007-05-26 05:21:36 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2007-07-11 19:09:01 -0400 |
commit | 80f03e349f06a261a8e980bf6005c61811a0d66a (patch) | |
tree | 91837f2ad36d42f2426621cdccd7765bf58734b2 /drivers | |
parent | 4f5c791a850e5305a5b1b48d0e4b4de248dc96f9 (diff) |
Driver core: add missing kset uevent
We get uevents for a bus/class going away, but not one registering.
Add the missing uevent in kset_register(), which will send an
event for a new bus/class. Suppress all unwanted uevents for bus
subdirectories like /bus/*/devices/, /bus/*/drivers/.
Now we get for module usbcore:
add /module/usbcore (module)
add /bus/usb (bus)
add /class/usb_host (class)
add /bus/usb/drivers/hub (drivers)
add /bus/usb/drivers/usb (drivers)
remove /bus/usb/drivers/usb (drivers)
remove /bus/usb/drivers/hub (drivers)
remove /class/usb_host (class)
remove /bus/usb (bus)
remove /module/usbcore (module)
instead of:
add /module/usbcore (module)
add /bus/usb/drivers/hub (drivers)
add /bus/usb/drivers/usb (drivers)
remove /bus/usb/drivers/usb (drivers)
remove /bus/usb/drivers/hub (drivers)
remove /class/usb_host (class)
remove /bus/usb/drivers (bus)
remove /bus/usb/devices (bus)
remove /bus/usb (bus)
remove /module/usbcore (module)
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/bus.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/drivers/base/bus.c b/drivers/base/bus.c index dca734819e50..7ff5aafe2167 100644 --- a/drivers/base/bus.c +++ b/drivers/base/bus.c | |||
@@ -138,12 +138,24 @@ void bus_remove_file(struct bus_type * bus, struct bus_attribute * attr) | |||
138 | } | 138 | } |
139 | } | 139 | } |
140 | 140 | ||
141 | static struct kobj_type ktype_bus = { | 141 | static struct kobj_type bus_ktype = { |
142 | .sysfs_ops = &bus_sysfs_ops, | 142 | .sysfs_ops = &bus_sysfs_ops, |
143 | }; | ||
144 | |||
145 | static int bus_uevent_filter(struct kset *kset, struct kobject *kobj) | ||
146 | { | ||
147 | struct kobj_type *ktype = get_ktype(kobj); | ||
148 | |||
149 | if (ktype == &bus_ktype) | ||
150 | return 1; | ||
151 | return 0; | ||
152 | } | ||
143 | 153 | ||
154 | static struct kset_uevent_ops bus_uevent_ops = { | ||
155 | .filter = bus_uevent_filter, | ||
144 | }; | 156 | }; |
145 | 157 | ||
146 | static decl_subsys(bus, &ktype_bus, NULL); | 158 | static decl_subsys(bus, &bus_ktype, &bus_uevent_ops); |
147 | 159 | ||
148 | 160 | ||
149 | #ifdef CONFIG_HOTPLUG | 161 | #ifdef CONFIG_HOTPLUG |