Skip to content

Commit 0665e38

Browse files
gthelengregkh
authored andcommitted
usb: xhci: avoid renesas_usb_fw.mem when it's unusable
Commit a66d21d ("usb: xhci: Add support for Renesas controller with memory") added renesas_usb_fw.mem firmware reference to xhci-pci. Thus modinfo indicates xhci-pci.ko has "firmware: renesas_usb_fw.mem". But the firmware is only actually used with CONFIG_USB_XHCI_PCI_RENESAS. An unusable firmware reference can trigger safety checkers which look for drivers with unmet firmware dependencies. Avoid referring to renesas_usb_fw.mem in circumstances when it cannot be loaded (when CONFIG_USB_XHCI_PCI_RENESAS isn't set). Fixes: a66d21d ("usb: xhci: Add support for Renesas controller with memory") Cc: stable <[email protected]> Signed-off-by: Greg Thelen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4bb233b commit 0665e38

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,14 @@ static const struct pci_device_id pci_ids[] = {
636636
{ /* end: all zeroes */ }
637637
};
638638
MODULE_DEVICE_TABLE(pci, pci_ids);
639+
640+
/*
641+
* Without CONFIG_USB_XHCI_PCI_RENESAS renesas_xhci_check_request_fw() won't
642+
* load firmware, so don't encumber the xhci-pci driver with it.
643+
*/
644+
#if IS_ENABLED(CONFIG_USB_XHCI_PCI_RENESAS)
639645
MODULE_FIRMWARE("renesas_usb_fw.mem");
646+
#endif
640647

641648
/* pci driver glue; this is a "new style" PCI driver module */
642649
static struct pci_driver xhci_pci_driver = {

0 commit comments

Comments
 (0)