diff options
| author | Zijun Hu <zijun.hu@oss.qualcomm.com> | 2026-07-25 01:54:43 -0700 |
|---|---|---|
| committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2026-08-07 15:38:30 -0400 |
| commit | 33971338ef4c5e596bf402b63fb61e3aae1ec6a2 (patch) | |
| tree | e3d601988b33a2dc46f6e6ed03b33b5543b8a9d6 /drivers/bluetooth | |
| parent | d6d15018c8e1527841e39a6a80c60997e594ca70 (diff) | |
Bluetooth: btusb: Add a simple static btusb_prepare_reset()
Add btusb_prepare_reset() to do cleanup before a reset, and
apply it to btusb_mtk_reset() as well.
Signed-off-by: Zijun Hu <zijun.hu@oss.qualcomm.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Diffstat (limited to 'drivers/bluetooth')
| -rw-r--r-- | drivers/bluetooth/btusb.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c index 03048e7eef21..b06784ad955c 100644 --- a/drivers/bluetooth/btusb.c +++ b/drivers/bluetooth/btusb.c @@ -2074,6 +2074,14 @@ static void btusb_stop_traffic(struct btusb_data *data) usb_kill_anchored_urbs(&data->ctrl_anchor); } +static void btusb_prepare_reset(struct hci_dev *hdev) +{ + struct btusb_data *data = hci_get_drvdata(hdev); + + btusb_stop_traffic(data); + usb_kill_anchored_urbs(&data->tx_anchor); +} + static int btusb_close(struct hci_dev *hdev) { struct btusb_data *data = hci_get_drvdata(hdev); @@ -2918,8 +2926,7 @@ static int btusb_mtk_reset(struct hci_dev *hdev, void *rst_data) /* Release MediaTek ISO data interface */ btusb_mtk_release_iso_intf(hdev); - btusb_stop_traffic(data); - usb_kill_anchored_urbs(&data->tx_anchor); + btusb_prepare_reset(hdev); /* Toggle the hard reset line. The MediaTek device is going to * yank itself off the USB and then replug. The cleanup is handled |
