aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sysfs.c
diff options
context:
space:
mode:
authorIngo Molnar <mingo@elte.hu>2009-06-01 15:06:21 -0400
committerIngo Molnar <mingo@elte.hu>2009-06-01 15:06:21 -0400
commit3d58f48ba05caed9118bce62b3047f8683438835 (patch)
tree94c911034f0e14ded73d3e9e6e9f8e22b6cad822 /net/bluetooth/hci_sysfs.c
parentabfe0af9813153bae8c85d9bac966bafcb8ddab1 (diff)
parentd9244b5d2fbfe9fa540024b410047af13ceec90f (diff)
Merge branch 'linus' into irq/numa
Conflicts: arch/mips/sibyte/bcm1480/irq.c arch/mips/sibyte/sb1250/irq.c Merge reason: we gathered a few conflicts plus update to latest upstream fixes. Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r--net/bluetooth/hci_sysfs.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 582d8877078c..4cc3624bd22d 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -88,14 +88,19 @@ static struct device_type bt_link = {
88static void add_conn(struct work_struct *work) 88static void add_conn(struct work_struct *work)
89{ 89{
90 struct hci_conn *conn = container_of(work, struct hci_conn, work_add); 90 struct hci_conn *conn = container_of(work, struct hci_conn, work_add);
91 struct hci_dev *hdev = conn->hdev;
91 92
92 /* ensure previous del is complete */ 93 /* ensure previous del is complete */
93 flush_work(&conn->work_del); 94 flush_work(&conn->work_del);
94 95
96 dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
97
95 if (device_add(&conn->dev) < 0) { 98 if (device_add(&conn->dev) < 0) {
96 BT_ERR("Failed to register connection device"); 99 BT_ERR("Failed to register connection device");
97 return; 100 return;
98 } 101 }
102
103 hci_dev_hold(hdev);
99} 104}
100 105
101/* 106/*
@@ -131,6 +136,7 @@ static void del_conn(struct work_struct *work)
131 136
132 device_del(&conn->dev); 137 device_del(&conn->dev);
133 put_device(&conn->dev); 138 put_device(&conn->dev);
139
134 hci_dev_put(hdev); 140 hci_dev_put(hdev);
135} 141}
136 142
@@ -154,12 +160,8 @@ void hci_conn_init_sysfs(struct hci_conn *conn)
154 160
155void hci_conn_add_sysfs(struct hci_conn *conn) 161void hci_conn_add_sysfs(struct hci_conn *conn)
156{ 162{
157 struct hci_dev *hdev = conn->hdev;
158
159 BT_DBG("conn %p", conn); 163 BT_DBG("conn %p", conn);
160 164
161 dev_set_name(&conn->dev, "%s:%d", hdev->name, conn->handle);
162
163 queue_work(bt_workq, &conn->work_add); 165 queue_work(bt_workq, &conn->work_add);
164} 166}
165 167