diff options
Diffstat (limited to 'net/bluetooth/a2mp.c')
-rw-r--r-- | net/bluetooth/a2mp.c | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/net/bluetooth/a2mp.c b/net/bluetooth/a2mp.c index e4f179117ae2..6bba3044dc7f 100644 --- a/net/bluetooth/a2mp.c +++ b/net/bluetooth/a2mp.c | |||
@@ -77,6 +77,23 @@ u8 __next_ident(struct amp_mgr *mgr) | |||
77 | return mgr->ident; | 77 | return mgr->ident; |
78 | } | 78 | } |
79 | 79 | ||
80 | static struct amp_mgr *amp_mgr_lookup_by_state(u8 state) | ||
81 | { | ||
82 | struct amp_mgr *mgr; | ||
83 | |||
84 | mutex_lock(&_mgr_list_lock); | ||
85 | list_for_each_entry(mgr, &_mgr_list, list) { | ||
86 | if (test_and_clear_bit(state, &mgr->state)) { | ||
87 | amp_mgr_get(mgr); | ||
88 | mutex_unlock(&_mgr_list_lock); | ||
89 | return mgr; | ||
90 | } | ||
91 | } | ||
92 | mutex_unlock(&_mgr_list_lock); | ||
93 | |||
94 | return NULL; | ||
95 | } | ||
96 | |||
80 | /* hci_dev_list shall be locked */ | 97 | /* hci_dev_list shall be locked */ |
81 | static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl) | 98 | static void __a2mp_add_cl(struct amp_mgr *mgr, struct a2mp_cl *cl) |
82 | { | 99 | { |
@@ -862,23 +879,6 @@ struct l2cap_chan *a2mp_channel_create(struct l2cap_conn *conn, | |||
862 | return mgr->a2mp_chan; | 879 | return mgr->a2mp_chan; |
863 | } | 880 | } |
864 | 881 | ||
865 | struct amp_mgr *amp_mgr_lookup_by_state(u8 state) | ||
866 | { | ||
867 | struct amp_mgr *mgr; | ||
868 | |||
869 | mutex_lock(&_mgr_list_lock); | ||
870 | list_for_each_entry(mgr, &_mgr_list, list) { | ||
871 | if (test_and_clear_bit(state, &mgr->state)) { | ||
872 | amp_mgr_get(mgr); | ||
873 | mutex_unlock(&_mgr_list_lock); | ||
874 | return mgr; | ||
875 | } | ||
876 | } | ||
877 | mutex_unlock(&_mgr_list_lock); | ||
878 | |||
879 | return NULL; | ||
880 | } | ||
881 | |||
882 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev) | 882 | void a2mp_send_getinfo_rsp(struct hci_dev *hdev) |
883 | { | 883 | { |
884 | struct amp_mgr *mgr; | 884 | struct amp_mgr *mgr; |