Skip to contentSkip to conversation

USB: Fix compilation error when CONFIG_PM disabled

PATCH In review Shawn Bohrer 3 participants 3 messages Aug 26, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: Fix compilation error when CONFIG_PM disabled

Commit 9a11899c5e699a8d "USB: OHCI: add missing PCI PM callbacks to ohci-pci.c" Introduced the following compilation errors when power management is disabled:

drivers/usb/host/ohci-pci.c: In function 'ohci_pci_init':
drivers/usb/host/ohci-pci.c:309:35: error: 'ohci_suspend' undeclared (first use in this function) drivers/usb/host/ohci-pci.c:309:35: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/host/ohci-pci.c:310:34: error: 'ohci_resume' undeclared (first use in this function)

ohci_suspend and ohci_resume are only defined when CONFIG_PM is defined so only use them under CONFIG_PM.

---
 drivers/usb/host/ohci-pci.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
drivers/usb/host/ohci-pci.c +2 -0
index 0f1d193..062b410 100644
@@ -305,9 +305,11 @@ static int __init ohci_pci_init(void)
 
 	ohci_init_driver(&ohci_pci_hc_driver, &pci_overrides);
 
+#ifdef CONFIG_PM
 	/* Entries for the PCI suspend/resume callbacks are special */
 	ohci_pci_hc_driver.pci_suspend = ohci_suspend;
 	ohci_pci_hc_driver.pci_resume = ohci_resume;
+#endif
 
 	return pci_register_driver(&ohci_pci_driver);
 }
Signature · 10 lines
1.7.7.6


-- 

---------------------------------------------------------------
This email, along with any attachments, is confidential. If you 
believe you received this message in error, please contact the 
sender immediately and delete all copies of the message.  
Thank you.
#1 lore raw
Quoted 9 lines · Shawn Bohrer

Commit 9a11899c5e699a8d "USB: OHCI: add missing PCI PM callbacks to ohci-pci.c" Introduced the following compilation errors when power management is disabled:

drivers/usb/host/ohci-pci.c: In function 'ohci_pci_init':
drivers/usb/host/ohci-pci.c:309:35: error: 'ohci_suspend' undeclared (first use in this function) drivers/usb/host/ohci-pci.c:309:35: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/host/ohci-pci.c:310:34: error: 'ohci_resume' undeclared (first use in this function)

Quoted 4 lines

ohci_suspend and ohci_resume are only defined when CONFIG_PM is defined so only use them under CONFIG_PM.

Alan sent this patch an hour or so ago, sorry.

I'll add your Signed-off-by: to his patch though, when I queue it up for Linus in a few hours (I'm in an airport at the moment...)

thanks,

greg k-h

maintainer
#2 lore raw
In reply to Shawn Bohrer
Quoted 11 lines · Shawn Bohrer

Commit 9a11899c5e699a8d "USB: OHCI: add missing PCI PM callbacks to ohci-pci.c" Introduced the following compilation errors when power management is disabled:

drivers/usb/host/ohci-pci.c: In function 'ohci_pci_init':
drivers/usb/host/ohci-pci.c:309:35: error: 'ohci_suspend' undeclared (first use in this function) drivers/usb/host/ohci-pci.c:309:35: note: each undeclared identifier is reported only once for each function it appears in drivers/usb/host/ohci-pci.c:310:34: error: 'ohci_resume' undeclared (first use in this function)

ohci_suspend and ohci_resume are only defined when CONFIG_PM is defined so only use them under CONFIG_PM.

Heh -- beat you to it.

	http://marc.info/?l=linux-usb&m=137752885015904&w=2

Alan Stern