Skip to content

Commit bf6d12b

Browse files
drmpegaloktiwa
authored andcommitted
Partial revert of xhci: use pm_ptr() instead #ifdef for CONFIG_PM conditionals
commit 448fe5a1a4b538b235a43e57863c3a078bd13b01 upstream. commit 9734fd7a2777 ("xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals") did not quite work properly in the 5.15.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]> (cherry picked from commit 4b7032d01ea1fd7bae1f5ce008aaf25f4857d07f) Signed-off-by: Alok Tiwari <[email protected]>
1 parent 3fc2410 commit bf6d12b

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
@@ -521,6 +521,7 @@ static void xhci_pci_remove(struct pci_dev *dev)
521521
usb_hcd_pci_remove(dev);
522522
}
523523

524+
#ifdef CONFIG_PM
524525
/*
525526
* In some Intel xHCI controllers, in order to get D3 working,
526527
* through a vendor specific SSIC CONFIG register at offset 0x883c,
@@ -661,6 +662,7 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
661662
if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
662663
pci_set_power_state(pdev, PCI_D3hot);
663664
}
665+
#endif /* CONFIG_PM */
664666

665667
/*-------------------------------------------------------------------------*/
666668

@@ -694,9 +696,11 @@ static struct pci_driver xhci_pci_driver = {
694696
static int __init xhci_pci_init(void)
695697
{
696698
xhci_init_driver(&xhci_pci_hc_driver, &xhci_pci_overrides);
699+
#ifdef CONFIG_PM
697700
xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
698701
xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
699702
xhci_pci_hc_driver.shutdown = xhci_pci_shutdown;
703+
#endif
700704
return pci_register_driver(&xhci_pci_driver);
701705
}
702706
module_init(xhci_pci_init);

0 commit comments

Comments
 (0)