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>
This commit is contained in:

committed by
Johan Hedberg

parent
73d0d3c867
commit
e9ca8bf157
@@ -208,9 +208,6 @@ static int hci_uart_open(struct hci_dev *hdev)
|
||||
BT_DBG("%s %p", hdev->name, hdev);
|
||||
|
||||
/* Nothing to do for UART driver */
|
||||
|
||||
set_bit(HCI_RUNNING, &hdev->flags);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -241,9 +238,6 @@ static int hci_uart_close(struct hci_dev *hdev)
|
||||
{
|
||||
BT_DBG("hdev %p", hdev);
|
||||
|
||||
if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
|
||||
return 0;
|
||||
|
||||
hci_uart_flush(hdev);
|
||||
hdev->flush = NULL;
|
||||
return 0;
|
||||
|
Reference in New Issue
Block a user