summaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth/bpa10x.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2015-10-04 17:34:02 -0400
committerJohan Hedberg <johan.hedberg@intel.com>2015-10-05 03:30:25 -0400
commite9ca8bf157f2b45f8f670517c96da313083ee9b2 (patch)
tree7aaa31766e0af85588a84f0d06d65d5b77375f7b /drivers/bluetooth/bpa10x.c
parent73d0d3c8671190ea982a8e79a7c79fbfe88f8f47 (diff)
Bluetooth: Move handling of HCI_RUNNING flag into core
Setting and clearing of HCI_RUNNING flag in each and every driver is just duplicating the same code all over the place. So instead of having the driver do it in their hdev->open and hdev->close callbacks, set it globally in the core transport handling. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
Diffstat (limited to 'drivers/bluetooth/bpa10x.c')
-rw-r--r--drivers/bluetooth/bpa10x.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/bluetooth/bpa10x.c b/drivers/bluetooth/bpa10x.c
index 59b892464be5..88e004ee137e 100644
--- a/drivers/bluetooth/bpa10x.c
+++ b/drivers/bluetooth/bpa10x.c
@@ -304,9 +304,6 @@ static int bpa10x_open(struct hci_dev *hdev)
304 304
305 BT_DBG("%s", hdev->name); 305 BT_DBG("%s", hdev->name);
306 306
307 if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
308 return 0;
309
310 err = bpa10x_submit_intr_urb(hdev); 307 err = bpa10x_submit_intr_urb(hdev);
311 if (err < 0) 308 if (err < 0)
312 goto error; 309 goto error;
@@ -320,8 +317,6 @@ static int bpa10x_open(struct hci_dev *hdev)
320error: 317error:
321 usb_kill_anchored_urbs(&data->rx_anchor); 318 usb_kill_anchored_urbs(&data->rx_anchor);
322 319
323 clear_bit(HCI_RUNNING, &hdev->flags);
324
325 return err; 320 return err;
326} 321}
327 322
@@ -331,9 +326,6 @@ static int bpa10x_close(struct hci_dev *hdev)
331 326
332 BT_DBG("%s", hdev->name); 327 BT_DBG("%s", hdev->name);
333 328
334 if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
335 return 0;
336
337 usb_kill_anchored_urbs(&data->rx_anchor); 329 usb_kill_anchored_urbs(&data->rx_anchor);
338 330
339 return 0; 331 return 0;