aboutsummaryrefslogtreecommitdiff
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 @@
#include <linux/etherdevice.h>
#include <linux/usb.h>
-#define D_LOCAL 1
-#include <linux/uwb/debug.h>
#include "uwb-internal.h"
static int uwb_rc_index_match(struct device *dev, void *data)
@@ -83,7 +81,6 @@ static void uwb_rc_sys_release(struct device *dev)
uwb_rc_neh_destroy(rc);
uwb_rc_ie_release(rc);
- d_printf(1, dev, "freed uwb_rc %p\n", rc);
kfree(rc);
}
@@ -100,6 +97,8 @@ void uwb_rc_init(struct uwb_rc *rc)
rc->scan_type = UWB_SCAN_DISABLED;
INIT_LIST_HEAD(&rc->notifs_chain.list);
mutex_init(&rc->notifs_chain.mutex);
+ INIT_LIST_HEAD(&rc->uwb_beca.list);
+ mutex_init(&rc->uwb_beca.mutex);
uwb_drp_avail_init(rc);
uwb_rc_ie_init(rc);
uwb_rsv_init(rc);
@@ -250,6 +249,12 @@ int uwb_rc_add(struct uwb_rc *rc, struct device *parent_dev, void *priv)
rc->priv = priv;
+ init_waitqueue_head(&rc->uwbd.wq);
+ INIT_LIST_HEAD(&rc->uwbd.event_list);
+ spin_lock_init(&rc->uwbd.event_list_lock);
+
+ uwbd_start(rc);
+
result = rc->start(rc);
if (result < 0)
goto error_rc_start;
@@ -284,7 +289,7 @@ error_sys_add:
error_dev_add:
error_rc_setup:
rc->stop(rc);
- uwbd_flush(rc);
+ uwbd_stop(rc);
error_rc_start:
return result;
}
@@ -315,16 +320,18 @@ void uwb_rc_rm(struct uwb_rc *rc)
uwb_rc_reset(rc);
rc->stop(rc);
- uwbd_flush(rc);
+
+ uwbd_stop(rc);
uwb_dev_lock(&rc->uwb_dev);
rc->priv = NULL;
rc->cmd = NULL;
uwb_dev_unlock(&rc->uwb_dev);
- mutex_lock(&uwb_beca.mutex);
+ mutex_lock(&rc->uwb_beca.mutex);
uwb_dev_for_each(rc, uwb_dev_offair_helper, NULL);
__uwb_rc_sys_rm(rc);
- mutex_unlock(&uwb_beca.mutex);
+ mutex_unlock(&rc->uwb_beca.mutex);
+ uwb_beca_release(rc);
uwb_dev_rm(&rc->uwb_dev);
}
EXPORT_SYMBOL_GPL(uwb_rc_rm);