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>
/* 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 */
/* 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;
}
BT_DBG("");
+ serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
+
err = p->open(hu);
if (err)
return err;