Skip to content

Commit

Permalink
Bluetooth: btusb: mediatek: add callback function in btusb_disconnect
Browse files Browse the repository at this point in the history
commit cea1805 upstream.

Add disconnect callback function in btusb_disconnect which is reserved
for vendor specific usage before deregister hci in btusb_disconnect.

Signed-off-by: Chris Lu <chris.lu@mediatek.com>
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Cc: Fedor Pchelkin <boddah8794@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Chris Lu authored and Greg Kroah-Hartman committed Jan 2, 2025
1 parent b967b37 commit 9da1cfc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/bluetooth/btusb.c
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@ struct btusb_data {

int (*suspend)(struct hci_dev *hdev);
int (*resume)(struct hci_dev *hdev);
int (*disconnect)(struct hci_dev *hdev);

int oob_wake_irq; /* irq for out-of-band wake-on-bt */
unsigned cmd_timeout_cnt;
Expand Down Expand Up @@ -4043,6 +4044,9 @@ static void btusb_disconnect(struct usb_interface *intf)
if (data->diag)
usb_set_intfdata(data->diag, NULL);

if (data->disconnect)
data->disconnect(hdev);

hci_unregister_dev(hdev);

if (intf == data->intf) {
Expand Down

0 comments on commit 9da1cfc

Please sign in to comment.