.. | .. |
---|
19 | 19 | #include "usb.h" |
---|
20 | 20 | |
---|
21 | 21 | static BLOCKING_NOTIFIER_HEAD(usb_notifier_list); |
---|
22 | | -static ATOMIC_NOTIFIER_HEAD(usb_atomic_notifier_list); |
---|
23 | 22 | |
---|
24 | 23 | /** |
---|
25 | 24 | * usb_register_notify - register a notifier callback whenever a usb change happens |
---|
.. | .. |
---|
54 | 53 | |
---|
55 | 54 | void usb_notify_remove_device(struct usb_device *udev) |
---|
56 | 55 | { |
---|
57 | | - /* Protect against simultaneous usbfs open */ |
---|
58 | | - mutex_lock(&usbfs_mutex); |
---|
59 | 56 | blocking_notifier_call_chain(&usb_notifier_list, |
---|
60 | 57 | USB_DEVICE_REMOVE, udev); |
---|
61 | | - mutex_unlock(&usbfs_mutex); |
---|
62 | 58 | } |
---|
63 | 59 | |
---|
64 | 60 | void usb_notify_add_bus(struct usb_bus *ubus) |
---|
.. | .. |
---|
69 | 65 | void usb_notify_remove_bus(struct usb_bus *ubus) |
---|
70 | 66 | { |
---|
71 | 67 | blocking_notifier_call_chain(&usb_notifier_list, USB_BUS_REMOVE, ubus); |
---|
72 | | -} |
---|
73 | | - |
---|
74 | | -/** |
---|
75 | | - * usb_register_atomic_notify - register a atomic notifier callback whenever a |
---|
76 | | - * HC dies |
---|
77 | | - * @nb: pointer to the atomic notifier block for the callback events. |
---|
78 | | - * |
---|
79 | | - */ |
---|
80 | | -void usb_register_atomic_notify(struct notifier_block *nb) |
---|
81 | | -{ |
---|
82 | | - atomic_notifier_chain_register(&usb_atomic_notifier_list, nb); |
---|
83 | | -} |
---|
84 | | -EXPORT_SYMBOL_GPL(usb_register_atomic_notify); |
---|
85 | | - |
---|
86 | | -/** |
---|
87 | | - * usb_unregister_atomic_notify - unregister a atomic notifier callback |
---|
88 | | - * @nb: pointer to the notifier block for the callback events. |
---|
89 | | - * |
---|
90 | | - */ |
---|
91 | | -void usb_unregister_atomic_notify(struct notifier_block *nb) |
---|
92 | | -{ |
---|
93 | | - atomic_notifier_chain_unregister(&usb_atomic_notifier_list, nb); |
---|
94 | | -} |
---|
95 | | -EXPORT_SYMBOL_GPL(usb_unregister_atomic_notify); |
---|
96 | | - |
---|
97 | | - |
---|
98 | | -void usb_atomic_notify_dead_bus(struct usb_bus *ubus) |
---|
99 | | -{ |
---|
100 | | - atomic_notifier_call_chain(&usb_atomic_notifier_list, USB_BUS_DIED, |
---|
101 | | - ubus); |
---|
102 | 68 | } |
---|