aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uwb/lc-rc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uwb/lc-rc.c')
-rw-r--r--drivers/uwb/lc-rc.c21
1 files changed, 14 insertions, 7 deletions
diff --git a/drivers/uwb/lc-rc.c b/drivers/uwb/lc-rc.c
index 1129e8767b5..38e3d57ec8f 100644
--- a/drivers/uwb/lc-rc.c
+++ b/drivers/uwb/lc-rc.c
@@ -36,8 +36,6 @@
36#include <linux/etherdevice.h> 36#include <linux/etherdevice.h>
37#include <linux/usb.h> 37#include <linux/usb.h>
38 38
39#define D_LOCAL 1
40#include <linux/uwb/debug.h>
41#include "uwb-internal.h" 39#include "uwb-internal.h"
42 40
43static int uwb_rc_index_match(struct device *dev, void *data) 41static int uwb_rc_index_match(struct device *dev, void *data)
@@ -83,7 +81,6 @@ static void uwb_rc_sys_release(struct device *dev)
83 81
84 uwb_rc_neh_destroy(rc); 82 uwb_rc_neh_destroy(rc);
85 uwb_rc_ie_release(rc); 83 uwb_rc_ie_release(rc);
86 d_printf(1, dev, "freed uwb_rc %p\n", rc);
87 kfree(rc); 84 kfree(rc);
88} 85}
89 86
@@ -100,6 +97,8 @@ void uwb_rc_init(struct uwb_rc *rc)
100 rc->scan_type = UWB_SCAN_DISABLED; 97 rc->scan_type = UWB_SCAN_DISABLED;
101 INIT_LIST_HEAD(&rc->notifs_chain.list); 98 INIT_LIST_HEAD(&rc->notifs_chain.list);
102 mutex_init(&rc->notifs_chain.mutex); 99 mutex_init(&rc->notifs_chain.mutex);
100 INIT_LIST_HEAD(&rc->uwb_beca.list);
101 mutex_init(&rc->uwb_beca.mutex);
103 uwb_drp_avail_init(rc); 102 uwb_drp_avail_init(rc);
104 uwb_rc_ie_init(rc); 103 uwb_rc_ie_init(rc);
105 uwb_rsv_init(rc); 104 uwb_rsv_init(rc);
@@ -250,6 +249,12 @@ int uwb_rc_add(struct uwb_rc *rc, struct device *parent_dev, void *priv)
250 249
251 rc->priv = priv; 250 rc->priv = priv;
252 251
252 init_waitqueue_head(&rc->uwbd.wq);
253 INIT_LIST_HEAD(&rc->uwbd.event_list);
254 spin_lock_init(&rc->uwbd.event_list_lock);
255
256 uwbd_start(rc);
257
253 result = rc->start(rc); 258 result = rc->start(rc);
254 if (result < 0) 259 if (result < 0)
255 goto error_rc_start; 260 goto error_rc_start;
@@ -284,7 +289,7 @@ error_sys_add:
284error_dev_add: 289error_dev_add:
285error_rc_setup: 290error_rc_setup:
286 rc->stop(rc); 291 rc->stop(rc);
287 uwbd_flush(rc); 292 uwbd_stop(rc);
288error_rc_start: 293error_rc_start:
289 return result; 294 return result;
290} 295}
@@ -315,16 +320,18 @@ void uwb_rc_rm(struct uwb_rc *rc)
315 uwb_rc_reset(rc); 320 uwb_rc_reset(rc);
316 321
317 rc->stop(rc); 322 rc->stop(rc);
318 uwbd_flush(rc); 323
324 uwbd_stop(rc);
319 325
320 uwb_dev_lock(&rc->uwb_dev); 326 uwb_dev_lock(&rc->uwb_dev);
321 rc->priv = NULL; 327 rc->priv = NULL;
322 rc->cmd = NULL; 328 rc->cmd = NULL;
323 uwb_dev_unlock(&rc->uwb_dev); 329 uwb_dev_unlock(&rc->uwb_dev);
324 mutex_lock(&uwb_beca.mutex); 330 mutex_lock(&rc->uwb_beca.mutex);
325 uwb_dev_for_each(rc, uwb_dev_offair_helper, NULL); 331 uwb_dev_for_each(rc, uwb_dev_offair_helper, NULL);
326 __uwb_rc_sys_rm(rc); 332 __uwb_rc_sys_rm(rc);
327 mutex_unlock(&uwb_beca.mutex); 333 mutex_unlock(&rc->uwb_beca.mutex);
334 uwb_beca_release(rc);
328 uwb_dev_rm(&rc->uwb_dev); 335 uwb_dev_rm(&rc->uwb_dev);
329} 336}
330EXPORT_SYMBOL_GPL(uwb_rc_rm); 337EXPORT_SYMBOL_GPL(uwb_rc_rm);