Add btusb_prepare_reset() to do cleanup before a reset, and apply it to btusb_mtk_reset() as well.
Unified · Split
| @@ -2074,6 +2074,14 @@ static void btusb_stop_traffic(struct btusb_data *data) · 2073 unmodified lines | ||
| 2074 | 2074 | usb_kill_anchored_urbs(&data->ctrl_anchor); |
| 2075 | 2075 | } |
| 2076 | 2076 | |
| 2077 | +static 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 | + | |
| 2077 | 2085 | static int btusb_close(struct hci_dev *hdev) |
| 2078 | 2086 | { |
| 2079 | 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 | 2926 | /* Release MediaTek ISO data interface */ |
| 2919 | 2927 | btusb_mtk_release_iso_intf(hdev); |
| 2920 | 2928 | |
| 2921 | − btusb_stop_traffic(data); | |
| 2922 | − usb_kill_anchored_urbs(&data->tx_anchor); | |
| 2929 | + btusb_prepare_reset(hdev); | |
| 2923 | 2930 | |
| 2924 | 2931 | /* Toggle the hard reset line. The MediaTek device is going to |
| 2925 | 2932 | * yank itself off the USB and then replug. The cleanup is handled |