History

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.

Zijun Hu committed 3 months ago

Commit 33971331 parent d6d15011 file · +9 −2Browse files

Unified · Split

drivers/bluetooth/btusb.c+9−2
@@ -2074,6 +2074,14 @@ static void btusb_stop_traffic(struct btusb_data *data) · 2073 unmodified lines
2074 usb_kill_anchored_urbs(&data->ctrl_anchor);2074 usb_kill_anchored_urbs(&data->ctrl_anchor);
2075}2075}
2076 2076
2077static void btusb_prepare_reset(struct hci_dev *hdev)
2078{
2079 struct btusb_data *data = hci_get_drvdata(hdev);
2080
2081 btusb_stop_traffic(data);
2082 usb_kill_anchored_urbs(&data->tx_anchor);
2083}
2084
2077static int btusb_close(struct hci_dev *hdev)2085static int btusb_close(struct hci_dev *hdev)
2078{2086{
2079 struct btusb_data *data = hci_get_drvdata(hdev);2087 struct btusb_data *data = hci_get_drvdata(hdev);
@@ -2918,8 +2926,7 @@ static int btusb_mtk_reset(struct hci_dev *hdev, void *rst_data) · 838 unmodified lines
2918 /* Release MediaTek ISO data interface */2926 /* Release MediaTek ISO data interface */
2919 btusb_mtk_release_iso_intf(hdev);2927 btusb_mtk_release_iso_intf(hdev);
2920 2928
2921 btusb_stop_traffic(data);2929 btusb_prepare_reset(hdev);
2922 usb_kill_anchored_urbs(&data->tx_anchor);
2923 2930
2924 /* Toggle the hard reset line. The MediaTek device is going to2931 /* Toggle the hard reset line. The MediaTek device is going to
2925 * yank itself off the USB and then replug. The cleanup is handled2932 * yank itself off the USB and then replug. The cleanup is handled

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t