xhci: Don't require a valid get_quirks() function pointer during xhci setup
authorMathias Nyman <mathias.nyman@linux.intel.com>
Fri, 2 Jun 2023 14:40:01 +0000 (17:40 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Jun 2023 09:34:49 +0000 (11:34 +0200)
Not all platforms drivers need to set up custom quirks during the xhci
generic setup. Allow them to pass NULL as the function pointer when
calling xhci_gen_setup()

Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Message-ID: <20230602144009.1225632-4-mathias.nyman@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/xhci.c

index 3a13e2453203ccf3d2a37616663bf59821093c64..176969bf2d5c33710795d4bda09ca9cf6fb9f61a 100644 (file)
@@ -5181,7 +5181,8 @@ int xhci_gen_setup(struct usb_hcd *hcd, xhci_get_quirks_t get_quirks)
 
        xhci->quirks |= quirks;
 
-       get_quirks(dev, xhci);
+       if (get_quirks)
+               get_quirks(dev, xhci);
 
        /* In xhci controllers which follow xhci 1.0 spec gives a spurious
         * success event after a short transfer. This quirk will ignore such