]> git.karo-electronics.de Git - linux-beck.git/commitdiff
Bluetooth: btusb: Use hardware error handler from Intel module
authorMarcel Holtmann <marcel@holtmann.org>
Sun, 5 Jul 2015 12:37:39 +0000 (14:37 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 23 Jul 2015 15:10:50 +0000 (17:10 +0200)
The Intel specific Bluetooth module provides now an exported function
for the hardware error. Use that instead of duplicating it inside the
driver.

Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
drivers/bluetooth/btusb.c

index b4cf8d9c9dac29893241cb9b814879969ed0906e..21bdb89da6ebf9fa7f138710e6ab3be93666ed9d 100644 (file)
@@ -2291,39 +2291,6 @@ done:
        return 0;
 }
 
-static void btusb_hw_error_intel(struct hci_dev *hdev, u8 code)
-{
-       struct sk_buff *skb;
-       u8 type = 0x00;
-
-       BT_ERR("%s: Hardware error 0x%2.2x", hdev->name, code);
-
-       skb = __hci_cmd_sync(hdev, HCI_OP_RESET, 0, NULL, HCI_INIT_TIMEOUT);
-       if (IS_ERR(skb)) {
-               BT_ERR("%s: Reset after hardware error failed (%ld)",
-                      hdev->name, PTR_ERR(skb));
-               return;
-       }
-       kfree_skb(skb);
-
-       skb = __hci_cmd_sync(hdev, 0xfc22, 1, &type, HCI_INIT_TIMEOUT);
-       if (IS_ERR(skb)) {
-               BT_ERR("%s: Retrieving Intel exception info failed (%ld)",
-                      hdev->name, PTR_ERR(skb));
-               return;
-       }
-
-       if (skb->len != 13) {
-               BT_ERR("%s: Exception info size mismatch", hdev->name);
-               kfree_skb(skb);
-               return;
-       }
-
-       BT_ERR("%s: Exception info %s", hdev->name, (char *)(skb->data + 1));
-
-       kfree_skb(skb);
-}
-
 static int btusb_shutdown_intel(struct hci_dev *hdev)
 {
        struct sk_buff *skb;
@@ -2783,7 +2750,7 @@ static int btusb_probe(struct usb_interface *intf,
        if (id->driver_info & BTUSB_INTEL_NEW) {
                hdev->send = btusb_send_frame_intel;
                hdev->setup = btusb_setup_intel_new;
-               hdev->hw_error = btusb_hw_error_intel;
+               hdev->hw_error = btintel_hw_error;
                hdev->set_bdaddr = btintel_set_bdaddr;
                set_bit(HCI_QUIRK_STRICT_DUPLICATE_FILTER, &hdev->quirks);
        }