USB: OHCI: fix build error related to ohci_suspend/resume
authorAlan Stern <stern@rowland.harvard.edu>
Mon, 26 Aug 2013 14:53:53 +0000 (10:53 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 26 Aug 2013 22:22:15 +0000 (15:22 -0700)
Commit 9a11899c5e69 (USB: OHCI: add missing PCI PM callbacks to
ohci-pci.c) added missing ohci_suspend and ohci_resume callback
pointers, but forgot that these callbacks are declared and defined
only when CONFIG_PM is enabled.

This patch adds a preprocessor conditional to avoid build errors when
PM is disabled.

Reported-by: Guenter Roeck <linux@roeck-us.net>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Reported-by: Meelis Roos <mroos@linux.ee>,
Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/host/ohci-pci.c

index 0f1d193fef02972163794fc611d8ee2f292cdc3a..279b04910f00feda16bbd9209aa723c9c0814d04 100644 (file)
@@ -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);
 }