Skip to content

Commit 4f9c1a0

Browse files
liveusrVudentz
authored andcommitted
Bluetooth: btusb: Add btusb devcoredump support
This patch implements the btusb driver side .coredump() callback to trigger a devcoredump via sysfs. Signed-off-by: Manish Mandlik <[email protected]> Reviewed-by: Abhishek Pandit-Subedi <[email protected]> Signed-off-by: Luiz Augusto von Dentz <[email protected]>
1 parent ab4e438 commit 4f9c1a0

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

drivers/bluetooth/btusb.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4397,6 +4397,17 @@ static int btusb_resume(struct usb_interface *intf)
43974397
}
43984398
#endif
43994399

4400+
#ifdef CONFIG_DEV_COREDUMP
4401+
static void btusb_coredump(struct device *dev)
4402+
{
4403+
struct btusb_data *data = dev_get_drvdata(dev);
4404+
struct hci_dev *hdev = data->hdev;
4405+
4406+
if (hdev->dump.coredump)
4407+
hdev->dump.coredump(hdev);
4408+
}
4409+
#endif
4410+
44004411
static struct usb_driver btusb_driver = {
44014412
.name = "btusb",
44024413
.probe = btusb_probe,
@@ -4408,6 +4419,14 @@ static struct usb_driver btusb_driver = {
44084419
.id_table = btusb_table,
44094420
.supports_autosuspend = 1,
44104421
.disable_hub_initiated_lpm = 1,
4422+
4423+
#ifdef CONFIG_DEV_COREDUMP
4424+
.drvwrap = {
4425+
.driver = {
4426+
.coredump = btusb_coredump,
4427+
},
4428+
},
4429+
#endif
44114430
};
44124431

44134432
module_usb_driver(btusb_driver);

0 commit comments

Comments
 (0)