Skip to content

Commit f6247d3

Browse files
drmpeggregkh
authored andcommitted
Partial revert of xhci: use pm_ptr() instead #ifdef for CONFIG_PM conditionals
commit 9734fd7 ("xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals") did not quite work properly in the 6.1.y branch where it was applied to fix a build error when CONFIG_PM was set as it left the following build errors still present: ERROR: modpost: "xhci_suspend" [drivers/usb/host/xhci-pci.ko] undefined! ERROR: modpost: "xhci_resume" [drivers/usb/host/xhci-pci.ko] undefined! Fix this up by properly placing the #ifdef CONFIG_PM in the xhci-pci.c and hcd.h files to handle this correctly. Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Ron Economos <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reported-by: Guenter Roeck <[email protected]> [ Trimmed the partial revert down to an even smaller bit to only be what is required to fix the build error - gregkh] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 60ceadf commit f6247d3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/usb/host/xhci-pci.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -571,6 +571,7 @@ static void xhci_pci_remove(struct pci_dev *dev)
571571
pci_set_power_state(dev, PCI_D3hot);
572572
}
573573

574+
#ifdef CONFIG_PM
574575
/*
575576
* In some Intel xHCI controllers, in order to get D3 working,
576577
* through a vendor specific SSIC CONFIG register at offset 0x883c,
@@ -720,6 +721,7 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
720721
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
721722
pci_set_power_state(pdev, PCI_D3hot);
722723
}
724+
#endif /* CONFIG_PM */
723725

724726
/*-------------------------------------------------------------------------*/
725727

@@ -769,9 +771,11 @@ static struct pci_driver xhci_pci_driver = {
769771
static int __init xhci_pci_init(void)
770772
{
771773
xhci_init_driver(&xhci_pci_hc_driver, &xhci_pci_overrides);
774+
#ifdef CONFIG_PM
772775
xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
773776
xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
774777
xhci_pci_hc_driver.shutdown = xhci_pci_shutdown;
778+
#endif
775779
return pci_register_driver(&xhci_pci_driver);
776780
}
777781
module_init(xhci_pci_init);

0 commit comments

Comments
 (0)