Commit 52b318e6 authored by Sebastian Reichel's avatar Sebastian Reichel Committed by Marcel Holtmann

Bluetooth: hci_serdev: do not open device in hci open

The device driver may need to communicate with the UART
device while the Bluetooth device is closed (e.g. due
to interrupts).
Acked-by: default avatarPavel Machek <pavel@ucw.cz>
Signed-off-by: default avatarSebastian Reichel <sre@kernel.org>
Signed-off-by: default avatarMarcel Holtmann <marcel@holtmann.org>
parent 82f5169b
...@@ -104,13 +104,9 @@ static void hci_uart_write_work(struct work_struct *work) ...@@ -104,13 +104,9 @@ static void hci_uart_write_work(struct work_struct *work)
/* Initialize device */ /* Initialize device */
static int hci_uart_open(struct hci_dev *hdev) static int hci_uart_open(struct hci_dev *hdev)
{ {
struct hci_uart *hu = hci_get_drvdata(hdev);
BT_DBG("%s %p", hdev->name, hdev); BT_DBG("%s %p", hdev->name, hdev);
serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops); return 0;
return serdev_device_open(hu->serdev);
} }
/* Reset device */ /* Reset device */
...@@ -136,15 +132,11 @@ static int hci_uart_flush(struct hci_dev *hdev) ...@@ -136,15 +132,11 @@ static int hci_uart_flush(struct hci_dev *hdev)
/* Close device */ /* Close device */
static int hci_uart_close(struct hci_dev *hdev) static int hci_uart_close(struct hci_dev *hdev)
{ {
struct hci_uart *hu = hci_get_drvdata(hdev);
BT_DBG("hdev %p", hdev); BT_DBG("hdev %p", hdev);
hci_uart_flush(hdev); hci_uart_flush(hdev);
hdev->flush = NULL; hdev->flush = NULL;
serdev_device_close(hu->serdev);
return 0; return 0;
} }
...@@ -289,6 +281,8 @@ int hci_uart_register_device(struct hci_uart *hu, ...@@ -289,6 +281,8 @@ int hci_uart_register_device(struct hci_uart *hu,
BT_DBG(""); BT_DBG("");
serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
err = p->open(hu); err = p->open(hu);
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment