Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 291001
b: refs/heads/master
c: 8ee5654
h: refs/heads/master
i:
  290999: 0816a98
v: v3
  • Loading branch information
Marcel Holtmann authored and Johan Hedberg committed Feb 21, 2012
1 parent 220700c commit 1dfbad5
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f0d4b78a68c4fe3b0d45de9a50e8d29419177b83
refs/heads/master: 8ee5654034c85b3915d078147a9d1064cac1852e
20 changes: 11 additions & 9 deletions trunk/net/bluetooth/hci_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -739,9 +739,6 @@ static int hci_dev_do_close(struct hci_dev *hdev)
hdev->discov_timeout = 0;
}

if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags))
cancel_delayed_work(&hdev->power_off);

if (test_and_clear_bit(HCI_SERVICE_CACHE, &hdev->dev_flags))
cancel_delayed_work(&hdev->service_cache);

Expand Down Expand Up @@ -787,9 +784,11 @@ static int hci_dev_do_close(struct hci_dev *hdev)
* and no tasks are scheduled. */
hdev->close(hdev);

hci_dev_lock(hdev);
mgmt_powered(hdev, 0);
hci_dev_unlock(hdev);
if (!test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags)) {
hci_dev_lock(hdev);
mgmt_powered(hdev, 0);
hci_dev_unlock(hdev);
}

/* Clear flags */
hdev->flags = 0;
Expand All @@ -808,7 +807,12 @@ int hci_dev_close(__u16 dev)
hdev = hci_dev_get(dev);
if (!hdev)
return -ENODEV;

if (test_and_clear_bit(HCI_AUTO_OFF, &hdev->dev_flags))
cancel_delayed_work(&hdev->power_off);

err = hci_dev_do_close(hdev);

hci_dev_put(hdev);
return err;
}
Expand Down Expand Up @@ -1102,9 +1106,7 @@ static void hci_power_off(struct work_struct *work)

BT_DBG("%s", hdev->name);

clear_bit(HCI_AUTO_OFF, &hdev->dev_flags);

hci_dev_close(hdev->id);
hci_dev_do_close(hdev);
}

static void hci_discov_off(struct work_struct *work)
Expand Down

0 comments on commit 1dfbad5

Please sign in to comment.