aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/amp.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bluetooth/amp.c')
-rw-r--r--net/bluetooth/amp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/net/bluetooth/amp.c b/net/bluetooth/amp.c
index b6e1c3ac74f1..2fc5562a84b9 100644
--- a/net/bluetooth/amp.c
+++ b/net/bluetooth/amp.c
@@ -45,7 +45,7 @@ int amp_ctrl_put(struct amp_ctrl *ctrl)
45 return kref_put(&ctrl->kref, &amp_ctrl_destroy); 45 return kref_put(&ctrl->kref, &amp_ctrl_destroy);
46} 46}
47 47
48struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr) 48struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr, u8 id)
49{ 49{
50 struct amp_ctrl *ctrl; 50 struct amp_ctrl *ctrl;
51 51
@@ -53,12 +53,13 @@ struct amp_ctrl *amp_ctrl_add(struct amp_mgr *mgr)
53 if (!ctrl) 53 if (!ctrl)
54 return NULL; 54 return NULL;
55 55
56 kref_init(&ctrl->kref);
57 ctrl->id = id;
58
56 mutex_lock(&mgr->amp_ctrls_lock); 59 mutex_lock(&mgr->amp_ctrls_lock);
57 list_add(&ctrl->list, &mgr->amp_ctrls); 60 list_add(&ctrl->list, &mgr->amp_ctrls);
58 mutex_unlock(&mgr->amp_ctrls_lock); 61 mutex_unlock(&mgr->amp_ctrls_lock);
59 62
60 kref_init(&ctrl->kref);
61
62 BT_DBG("mgr %p ctrl %p", mgr, ctrl); 63 BT_DBG("mgr %p ctrl %p", mgr, ctrl);
63 64
64 return ctrl; 65 return ctrl;