Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: ohci-at91: use __maybe_unused to hide pm functions

The ohci-at91 driver uses #ifdef to check for CONFIG_PM, but then
uses SIMPLE_DEV_PM_OPS, which leaves the references out when
CONFIG_PM_SLEEP is not defined, so we get a warning with
PM=y && PM_SLEEP=n:

drivers/usb/host/ohci-at91.c:587:1: error: 'ohci_hcd_at91_drv_suspend' defined but not used [-Werror=unused-function]
drivers/usb/host/ohci-at91.c:631:12: error: 'ohci_hcd_at91_drv_resume' defined but not used [-Werror=unused-function]

This removes the incorrect #ifdef and instead uses a __maybe_unused
annotation to let the compiler know it can silently drop
the function definition.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
d2905193 8dac5300

+3 -5
+3 -5
drivers/usb/host/ohci-at91.c
··· 583 583 return 0; 584 584 } 585 585 586 - #ifdef CONFIG_PM 587 - 588 - static int 586 + static int __maybe_unused 589 587 ohci_hcd_at91_drv_suspend(struct device *dev) 590 588 { 591 589 struct usb_hcd *hcd = dev_get_drvdata(dev); ··· 628 630 return ret; 629 631 } 630 632 631 - static int ohci_hcd_at91_drv_resume(struct device *dev) 633 + static int __maybe_unused 634 + ohci_hcd_at91_drv_resume(struct device *dev) 632 635 { 633 636 struct usb_hcd *hcd = dev_get_drvdata(dev); 634 637 struct ohci_at91_priv *ohci_at91 = hcd_to_ohci_at91_priv(hcd); ··· 642 643 ohci_resume(hcd, false); 643 644 return 0; 644 645 } 645 - #endif 646 646 647 647 static SIMPLE_DEV_PM_OPS(ohci_hcd_at91_pm_ops, ohci_hcd_at91_drv_suspend, 648 648 ohci_hcd_at91_drv_resume);