Commit 4dec9b807be757780ca3611a959ac22c28d292a7
Committed by
John W. Linville
1 parent
6fb532527e
Exists in
master
and in
39 other branches
rfkill: strip pointless notifier chain
No users, so no reason to have it. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Acked-by: Ivo van Doorn <IvDoorn@gmail.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Showing 2 changed files with 5 additions and 85 deletions Side-by-side Diff
include/linux/rfkill.h
... | ... | @@ -149,12 +149,5 @@ |
149 | 149 | #endif |
150 | 150 | } |
151 | 151 | |
152 | -/* rfkill notification chain */ | |
153 | -#define RFKILL_STATE_CHANGED 0x0001 /* state of a normal rfkill | |
154 | - switch has changed */ | |
155 | - | |
156 | -int register_rfkill_notifier(struct notifier_block *nb); | |
157 | -int unregister_rfkill_notifier(struct notifier_block *nb); | |
158 | - | |
159 | 152 | #endif /* RFKILL_H */ |
net/rfkill/rfkill.c
... | ... | @@ -53,52 +53,7 @@ |
53 | 53 | static unsigned long rfkill_states_lockdflt[BITS_TO_LONGS(RFKILL_TYPE_MAX)]; |
54 | 54 | static bool rfkill_epo_lock_active; |
55 | 55 | |
56 | -static BLOCKING_NOTIFIER_HEAD(rfkill_notifier_list); | |
57 | 56 | |
58 | - | |
59 | -/** | |
60 | - * register_rfkill_notifier - Add notifier to rfkill notifier chain | |
61 | - * @nb: pointer to the new entry to add to the chain | |
62 | - * | |
63 | - * See blocking_notifier_chain_register() for return value and further | |
64 | - * observations. | |
65 | - * | |
66 | - * Adds a notifier to the rfkill notifier chain. The chain will be | |
67 | - * called with a pointer to the relevant rfkill structure as a parameter, | |
68 | - * refer to include/linux/rfkill.h for the possible events. | |
69 | - * | |
70 | - * Notifiers added to this chain are to always return NOTIFY_DONE. This | |
71 | - * chain is a blocking notifier chain: notifiers can sleep. | |
72 | - * | |
73 | - * Calls to this chain may have been done through a workqueue. One must | |
74 | - * assume unordered asynchronous behaviour, there is no way to know if | |
75 | - * actions related to the event that generated the notification have been | |
76 | - * carried out already. | |
77 | - */ | |
78 | -int register_rfkill_notifier(struct notifier_block *nb) | |
79 | -{ | |
80 | - BUG_ON(!nb); | |
81 | - return blocking_notifier_chain_register(&rfkill_notifier_list, nb); | |
82 | -} | |
83 | -EXPORT_SYMBOL_GPL(register_rfkill_notifier); | |
84 | - | |
85 | -/** | |
86 | - * unregister_rfkill_notifier - remove notifier from rfkill notifier chain | |
87 | - * @nb: pointer to the entry to remove from the chain | |
88 | - * | |
89 | - * See blocking_notifier_chain_unregister() for return value and further | |
90 | - * observations. | |
91 | - * | |
92 | - * Removes a notifier from the rfkill notifier chain. | |
93 | - */ | |
94 | -int unregister_rfkill_notifier(struct notifier_block *nb) | |
95 | -{ | |
96 | - BUG_ON(!nb); | |
97 | - return blocking_notifier_chain_unregister(&rfkill_notifier_list, nb); | |
98 | -} | |
99 | -EXPORT_SYMBOL_GPL(unregister_rfkill_notifier); | |
100 | - | |
101 | - | |
102 | 57 | static void rfkill_led_trigger(struct rfkill *rfkill, |
103 | 58 | enum rfkill_state state) |
104 | 59 | { |
105 | 60 | |
... | ... | @@ -124,12 +79,9 @@ |
124 | 79 | } |
125 | 80 | #endif /* CONFIG_RFKILL_LEDS */ |
126 | 81 | |
127 | -static void notify_rfkill_state_change(struct rfkill *rfkill) | |
82 | +static void rfkill_uevent(struct rfkill *rfkill) | |
128 | 83 | { |
129 | - rfkill_led_trigger(rfkill, rfkill->state); | |
130 | - blocking_notifier_call_chain(&rfkill_notifier_list, | |
131 | - RFKILL_STATE_CHANGED, | |
132 | - rfkill); | |
84 | + kobject_uevent(&rfkill->dev.kobj, KOBJ_CHANGE); | |
133 | 85 | } |
134 | 86 | |
135 | 87 | static void update_rfkill_state(struct rfkill *rfkill) |
... | ... | @@ -142,7 +94,7 @@ |
142 | 94 | oldstate = rfkill->state; |
143 | 95 | rfkill->state = newstate; |
144 | 96 | if (oldstate != newstate) |
145 | - notify_rfkill_state_change(rfkill); | |
97 | + rfkill_uevent(rfkill); | |
146 | 98 | } |
147 | 99 | mutex_unlock(&rfkill->mutex); |
148 | 100 | } |
... | ... | @@ -220,7 +172,7 @@ |
220 | 172 | } |
221 | 173 | |
222 | 174 | if (force || rfkill->state != oldstate) |
223 | - notify_rfkill_state_change(rfkill); | |
175 | + rfkill_uevent(rfkill); | |
224 | 176 | |
225 | 177 | return retval; |
226 | 178 | } |
... | ... | @@ -405,7 +357,7 @@ |
405 | 357 | rfkill->state = state; |
406 | 358 | |
407 | 359 | if (state != oldstate) |
408 | - notify_rfkill_state_change(rfkill); | |
360 | + rfkill_uevent(rfkill); | |
409 | 361 | |
410 | 362 | mutex_unlock(&rfkill->mutex); |
411 | 363 | |
... | ... | @@ -618,28 +570,6 @@ |
618 | 570 | #define rfkill_resume NULL |
619 | 571 | #endif |
620 | 572 | |
621 | -static int rfkill_blocking_uevent_notifier(struct notifier_block *nb, | |
622 | - unsigned long eventid, | |
623 | - void *data) | |
624 | -{ | |
625 | - struct rfkill *rfkill = (struct rfkill *)data; | |
626 | - | |
627 | - switch (eventid) { | |
628 | - case RFKILL_STATE_CHANGED: | |
629 | - kobject_uevent(&rfkill->dev.kobj, KOBJ_CHANGE); | |
630 | - break; | |
631 | - default: | |
632 | - break; | |
633 | - } | |
634 | - | |
635 | - return NOTIFY_DONE; | |
636 | -} | |
637 | - | |
638 | -static struct notifier_block rfkill_blocking_uevent_nb = { | |
639 | - .notifier_call = rfkill_blocking_uevent_notifier, | |
640 | - .priority = 0, | |
641 | -}; | |
642 | - | |
643 | 573 | static int rfkill_dev_uevent(struct device *dev, struct kobj_uevent_env *env) |
644 | 574 | { |
645 | 575 | struct rfkill *rfkill = to_rfkill(dev); |
646 | 576 | |
... | ... | @@ -942,14 +872,11 @@ |
942 | 872 | return error; |
943 | 873 | } |
944 | 874 | |
945 | - register_rfkill_notifier(&rfkill_blocking_uevent_nb); | |
946 | - | |
947 | 875 | return 0; |
948 | 876 | } |
949 | 877 | |
950 | 878 | static void __exit rfkill_exit(void) |
951 | 879 | { |
952 | - unregister_rfkill_notifier(&rfkill_blocking_uevent_nb); | |
953 | 880 | class_unregister(&rfkill_class); |
954 | 881 | } |
955 | 882 |