Skip to content

Commit 52b318e

Browse files
sreholtmann
authored andcommitted
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: Pavel Machek <[email protected]> Signed-off-by: Sebastian Reichel <[email protected]> Signed-off-by: Marcel Holtmann <[email protected]>
1 parent 82f5169 commit 52b318e

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

drivers/bluetooth/hci_serdev.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -104,13 +104,9 @@ static void hci_uart_write_work(struct work_struct *work)
104104
/* Initialize device */
105105
static int hci_uart_open(struct hci_dev *hdev)
106106
{
107-
struct hci_uart *hu = hci_get_drvdata(hdev);
108-
109107
BT_DBG("%s %p", hdev->name, hdev);
110108

111-
serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
112-
113-
return serdev_device_open(hu->serdev);
109+
return 0;
114110
}
115111

116112
/* Reset device */
@@ -136,15 +132,11 @@ static int hci_uart_flush(struct hci_dev *hdev)
136132
/* Close device */
137133
static int hci_uart_close(struct hci_dev *hdev)
138134
{
139-
struct hci_uart *hu = hci_get_drvdata(hdev);
140-
141135
BT_DBG("hdev %p", hdev);
142136

143137
hci_uart_flush(hdev);
144138
hdev->flush = NULL;
145139

146-
serdev_device_close(hu->serdev);
147-
148140
return 0;
149141
}
150142

@@ -289,6 +281,8 @@ int hci_uart_register_device(struct hci_uart *hu,
289281

290282
BT_DBG("");
291283

284+
serdev_device_set_client_ops(hu->serdev, &hci_serdev_client_ops);
285+
292286
err = p->open(hu);
293287
if (err)
294288
return err;

0 commit comments

Comments
 (0)