Skip to content

Commit

Permalink
Bluetooth: hci_serdev: do not open device in hci open
Browse files Browse the repository at this point in the history
The device driver may need to communicate with the UART
device while the Bluetooth device is closed (e.g. due
to interrupts).

Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
  • Loading branch information
Sebastian Reichel authored and Marcel Holtmann committed Apr 12, 2017
1 parent 82f5169 commit 52b318e
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions drivers/bluetooth/hci_serdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -104,13 +104,9 @@ static void hci_uart_write_work(struct work_struct *work)
/* Initialize device */
static int hci_uart_open(struct hci_dev *hdev)
{
struct hci_uart *hu = hci_get_drvdata(hdev);

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

serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);

return serdev_device_open(hu->serdev);
return 0;
}

/* Reset device */
Expand All @@ -136,15 +132,11 @@ static int hci_uart_flush(struct hci_dev *hdev)
/* Close device */
static int hci_uart_close(struct hci_dev *hdev)
{
struct hci_uart *hu = hci_get_drvdata(hdev);

BT_DBG("hdev %p", hdev);

hci_uart_flush(hdev);
hdev->flush = NULL;

serdev_device_close(hu->serdev);

return 0;
}

Expand Down Expand Up @@ -289,6 +281,8 @@ int hci_uart_register_device(struct hci_uart *hu,

BT_DBG("");

serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);

err = p->open(hu);
if (err)
return err;
Expand Down

0 comments on commit 52b318e

Please sign in to comment.