diff mbox series

[Bug,217651] BCM20702B0 Bluetooth device in MacBook no longer working

Message ID bug-217651-62941-MQgb6EFOlf@https.bugzilla.kernel.org/ (mailing list archive)
State Superseded
Headers show
Series [Bug,217651] BCM20702B0 Bluetooth device in MacBook no longer working | expand

Checks

Context Check Description
tedd_an/pre-ci_am fail error: patch failed: drivers/bluetooth/btusb.c:4104 error: drivers/bluetooth/btusb.c: patch does not apply hint: Use 'git am --show-current-patch' to see the failed patch

Commit Message

bugzilla-daemon@kernel.org July 13, 2023, 5:58 a.m. UTC
https://bugzilla.kernel.org/show_bug.cgi?id=217651

--- Comment #18 from Tomasz Moń (desowin@gmail.com) ---
The previous proposal is bogus as I messed up the conditions again. It would
reject anything with BTUSB_IFNUM_2 when the interface is either 0 or 2. What we
want is to allow either 0 or 2 when BTUSB_IFNUM_2 is set.

The correct patch to try would be:
diff mbox series

Patch

diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 5ec4ad0a5c86..764d176e9735 100644
--- a/drivers/bluetooth/btusb.c
+++ b/drivers/bluetooth/btusb.c
@@ -4104,6 +4104,7 @@  static int btusb_probe(struct usb_interface *intf,
        BT_DBG("intf %p id %p", intf, id);

        if ((id->driver_info & BTUSB_IFNUM_2) &&
+           (intf->cur_altsetting->desc.bInterfaceNumber != 0) &&
            (intf->cur_altsetting->desc.bInterfaceNumber != 2))
                return -ENODEV;