aboutsummaryrefslogtreecommitdiffstats
path: root/net/bluetooth/hci_sysfs.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-03-20 10:20:04 -0400
committerMarcel Holtmann <marcel@holtmann.org>2010-05-10 03:34:03 -0400
commitf48fd9c8cd746fdb055a97249a209c77dca0f710 (patch)
treea3ab4ba27edc43bf3527a02fd7c6ba4167213056 /net/bluetooth/hci_sysfs.c
parent844c0972427ee5f661158160aaca10b22b3dda60 (diff)
Bluetooth: Create per controller workqueue
Instead of having a global workqueue for all controllers, it makes more sense to have a workqueue per controller. Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Diffstat (limited to 'net/bluetooth/hci_sysfs.c')
-rw-r--r--net/bluetooth/hci_sysfs.c16
1 files changed, 3 insertions, 13 deletions
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c
index 0e8e1a59856c..a978449ab04d 100644
--- a/net/bluetooth/hci_sysfs.c
+++ b/net/bluetooth/hci_sysfs.c
@@ -14,8 +14,6 @@ static struct class *bt_class;
14struct dentry *bt_debugfs = NULL; 14struct dentry *bt_debugfs = NULL;
15EXPORT_SYMBOL_GPL(bt_debugfs); 15EXPORT_SYMBOL_GPL(bt_debugfs);
16 16
17static struct workqueue_struct *bt_workq;
18
19static inline char *link_typetostr(int type) 17static inline char *link_typetostr(int type)
20{ 18{
21 switch (type) { 19 switch (type) {
@@ -161,14 +159,14 @@ void hci_conn_add_sysfs(struct hci_conn *conn)
161{ 159{
162 BT_DBG("conn %p", conn); 160 BT_DBG("conn %p", conn);
163 161
164 queue_work(bt_workq, &conn->work_add); 162 queue_work(conn->hdev->workqueue, &conn->work_add);
165} 163}
166 164
167void hci_conn_del_sysfs(struct hci_conn *conn) 165void hci_conn_del_sysfs(struct hci_conn *conn)
168{ 166{
169 BT_DBG("conn %p", conn); 167 BT_DBG("conn %p", conn);
170 168
171 queue_work(bt_workq, &conn->work_del); 169 queue_work(conn->hdev->workqueue, &conn->work_del);
172} 170}
173 171
174static inline char *host_bustostr(int bus) 172static inline char *host_bustostr(int bus)
@@ -487,17 +485,11 @@ void hci_unregister_sysfs(struct hci_dev *hdev)
487 485
488int __init bt_sysfs_init(void) 486int __init bt_sysfs_init(void)
489{ 487{
490 bt_workq = create_singlethread_workqueue("bluetooth");
491 if (!bt_workq)
492 return -ENOMEM;
493
494 bt_debugfs = debugfs_create_dir("bluetooth", NULL); 488 bt_debugfs = debugfs_create_dir("bluetooth", NULL);
495 489
496 bt_class = class_create(THIS_MODULE, "bluetooth"); 490 bt_class = class_create(THIS_MODULE, "bluetooth");
497 if (IS_ERR(bt_class)) { 491 if (IS_ERR(bt_class))
498 destroy_workqueue(bt_workq);
499 return PTR_ERR(bt_class); 492 return PTR_ERR(bt_class);
500 }
501 493
502 return 0; 494 return 0;
503} 495}
@@ -507,6 +499,4 @@ void bt_sysfs_cleanup(void)
507 class_destroy(bt_class); 499 class_destroy(bt_class);
508 500
509 debugfs_remove_recursive(bt_debugfs); 501 debugfs_remove_recursive(bt_debugfs);
510
511 destroy_workqueue(bt_workq);
512} 502}