diff options
Diffstat (limited to 'net/bluetooth/rfcomm/tty.c')
-rw-r--r-- | net/bluetooth/rfcomm/tty.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/net/bluetooth/rfcomm/tty.c b/net/bluetooth/rfcomm/tty.c index 403ec09f480a..8e385a0ae60e 100644 --- a/net/bluetooth/rfcomm/tty.c +++ b/net/bluetooth/rfcomm/tty.c | |||
@@ -70,7 +70,7 @@ struct rfcomm_dev { | |||
70 | }; | 70 | }; |
71 | 71 | ||
72 | static LIST_HEAD(rfcomm_dev_list); | 72 | static LIST_HEAD(rfcomm_dev_list); |
73 | static DEFINE_SPINLOCK(rfcomm_dev_lock); | 73 | static DEFINE_MUTEX(rfcomm_dev_lock); |
74 | 74 | ||
75 | static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb); | 75 | static void rfcomm_dev_data_ready(struct rfcomm_dlc *dlc, struct sk_buff *skb); |
76 | static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err); | 76 | static void rfcomm_dev_state_change(struct rfcomm_dlc *dlc, int err); |
@@ -96,9 +96,9 @@ static void rfcomm_dev_destruct(struct tty_port *port) | |||
96 | if (dev->tty_dev) | 96 | if (dev->tty_dev) |
97 | tty_unregister_device(rfcomm_tty_driver, dev->id); | 97 | tty_unregister_device(rfcomm_tty_driver, dev->id); |
98 | 98 | ||
99 | spin_lock(&rfcomm_dev_lock); | 99 | mutex_lock(&rfcomm_dev_lock); |
100 | list_del(&dev->list); | 100 | list_del(&dev->list); |
101 | spin_unlock(&rfcomm_dev_lock); | 101 | mutex_unlock(&rfcomm_dev_lock); |
102 | 102 | ||
103 | kfree(dev); | 103 | kfree(dev); |
104 | 104 | ||
@@ -161,14 +161,14 @@ static struct rfcomm_dev *rfcomm_dev_get(int id) | |||
161 | { | 161 | { |
162 | struct rfcomm_dev *dev; | 162 | struct rfcomm_dev *dev; |
163 | 163 | ||
164 | spin_lock(&rfcomm_dev_lock); | 164 | mutex_lock(&rfcomm_dev_lock); |
165 | 165 | ||
166 | dev = __rfcomm_dev_lookup(id); | 166 | dev = __rfcomm_dev_lookup(id); |
167 | 167 | ||
168 | if (dev && !tty_port_get(&dev->port)) | 168 | if (dev && !tty_port_get(&dev->port)) |
169 | dev = NULL; | 169 | dev = NULL; |
170 | 170 | ||
171 | spin_unlock(&rfcomm_dev_lock); | 171 | mutex_unlock(&rfcomm_dev_lock); |
172 | 172 | ||
173 | return dev; | 173 | return dev; |
174 | } | 174 | } |
@@ -224,7 +224,7 @@ static struct rfcomm_dev *__rfcomm_dev_add(struct rfcomm_dev_req *req, | |||
224 | if (!dev) | 224 | if (!dev) |
225 | return ERR_PTR(-ENOMEM); | 225 | return ERR_PTR(-ENOMEM); |
226 | 226 | ||
227 | spin_lock(&rfcomm_dev_lock); | 227 | mutex_lock(&rfcomm_dev_lock); |
228 | 228 | ||
229 | if (req->dev_id < 0) { | 229 | if (req->dev_id < 0) { |
230 | dev->id = 0; | 230 | dev->id = 0; |
@@ -305,11 +305,11 @@ static struct rfcomm_dev *__rfcomm_dev_add(struct rfcomm_dev_req *req, | |||
305 | holds reference to this module. */ | 305 | holds reference to this module. */ |
306 | __module_get(THIS_MODULE); | 306 | __module_get(THIS_MODULE); |
307 | 307 | ||
308 | spin_unlock(&rfcomm_dev_lock); | 308 | mutex_unlock(&rfcomm_dev_lock); |
309 | return dev; | 309 | return dev; |
310 | 310 | ||
311 | out: | 311 | out: |
312 | spin_unlock(&rfcomm_dev_lock); | 312 | mutex_unlock(&rfcomm_dev_lock); |
313 | kfree(dev); | 313 | kfree(dev); |
314 | return ERR_PTR(err); | 314 | return ERR_PTR(err); |
315 | } | 315 | } |
@@ -524,7 +524,7 @@ static int rfcomm_get_dev_list(void __user *arg) | |||
524 | 524 | ||
525 | di = dl->dev_info; | 525 | di = dl->dev_info; |
526 | 526 | ||
527 | spin_lock(&rfcomm_dev_lock); | 527 | mutex_lock(&rfcomm_dev_lock); |
528 | 528 | ||
529 | list_for_each_entry(dev, &rfcomm_dev_list, list) { | 529 | list_for_each_entry(dev, &rfcomm_dev_list, list) { |
530 | if (!tty_port_get(&dev->port)) | 530 | if (!tty_port_get(&dev->port)) |
@@ -540,7 +540,7 @@ static int rfcomm_get_dev_list(void __user *arg) | |||
540 | break; | 540 | break; |
541 | } | 541 | } |
542 | 542 | ||
543 | spin_unlock(&rfcomm_dev_lock); | 543 | mutex_unlock(&rfcomm_dev_lock); |
544 | 544 | ||
545 | dl->dev_num = n; | 545 | dl->dev_num = n; |
546 | size = sizeof(*dl) + n * sizeof(*di); | 546 | size = sizeof(*dl) + n * sizeof(*di); |