Skip to contentSkip to conversation

usb: xhci: fix unused function warning

PATCH New Chen Zhou 1 participant 1 message Dec 19, 2019

Subsystems (2)
lore
Share & tools
lore

Chen Zhou

author
#0 lore raw

PATCH 1/1 usb: xhci: fix unused function warning

xhci_pci_shutdown() function is no longer called outside of the CONFIG_PM #ifdef section, causing a harmless warning:

drivers/usb/host/xhci-pci.c:524:13: warning: ‘xhci_pci_shutdown’ defined but not used [-Wunused-function]
static void xhci_pci_shutdown(struct usb_hcd *hcd)

This moves the function into the #ifdef to get a clean build again.

Fixes f2c710f7dca8 ("usb: xhci: only set D3hot for pci device")
---
 drivers/usb/host/xhci-pci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/host/xhci-pci.c +1 -1
index 2907fe4..4917c5b 100644
@@ -519,7 +519,6 @@ static int xhci_pci_resume(struct usb_hcd *hcd, bool hibernated)
 	retval = xhci_resume(xhci, hibernated);
 	return retval;
 }
-#endif /* CONFIG_PM */
 
 static void xhci_pci_shutdown(struct usb_hcd *hcd)
 {
@@ -532,6 +531,7 @@ static void xhci_pci_shutdown(struct usb_hcd *hcd)
 	if (xhci->quirks & XHCI_SPURIOUS_WAKEUP)
 		pci_set_power_state(pdev, PCI_D3hot);
 }
+#endif /* CONFIG_PM */
 
 /*-------------------------------------------------------------------------*/
 
Signature · 1 line
2.7.4