diff options
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r-- | net/bluetooth/hci_sysfs.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index d4c935692ccf..801d687ea4ef 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -242,7 +242,7 @@ static void add_conn(struct work_struct *work) | |||
242 | struct hci_conn *conn = container_of(work, struct hci_conn, work); | 242 | struct hci_conn *conn = container_of(work, struct hci_conn, work); |
243 | int i; | 243 | int i; |
244 | 244 | ||
245 | if (device_register(&conn->dev) < 0) { | 245 | if (device_add(&conn->dev) < 0) { |
246 | BT_ERR("Failed to register connection device"); | 246 | BT_ERR("Failed to register connection device"); |
247 | return; | 247 | return; |
248 | } | 248 | } |
@@ -272,6 +272,8 @@ void hci_conn_add_sysfs(struct hci_conn *conn) | |||
272 | 272 | ||
273 | dev_set_drvdata(&conn->dev, conn); | 273 | dev_set_drvdata(&conn->dev, conn); |
274 | 274 | ||
275 | device_initialize(&conn->dev); | ||
276 | |||
275 | INIT_WORK(&conn->work, add_conn); | 277 | INIT_WORK(&conn->work, add_conn); |
276 | 278 | ||
277 | schedule_work(&conn->work); | 279 | schedule_work(&conn->work); |
@@ -287,6 +289,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn) | |||
287 | { | 289 | { |
288 | BT_DBG("conn %p", conn); | 290 | BT_DBG("conn %p", conn); |
289 | 291 | ||
292 | if (!device_is_registered(&conn->dev)) | ||
293 | return; | ||
294 | |||
290 | INIT_WORK(&conn->work, del_conn); | 295 | INIT_WORK(&conn->work, del_conn); |
291 | 296 | ||
292 | schedule_work(&conn->work); | 297 | schedule_work(&conn->work); |