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

usb: ehci-atmel: use __maybe_unused to hide pm functions

The ehci-atmel 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/ehci-atmel.c:189:12: error: 'ehci_atmel_drv_suspend' defined but not used [-Werror=unused-function]
drivers/usb/host/ehci-atmel.c:203:12: error: 'ehci_atmel_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
9fc7c85d d2905193

+2 -4
+2 -4
drivers/usb/host/ehci-atmel.c
··· 185 185 return 0; 186 186 } 187 187 188 - #ifdef CONFIG_PM 189 - static int ehci_atmel_drv_suspend(struct device *dev) 188 + static int __maybe_unused ehci_atmel_drv_suspend(struct device *dev) 190 189 { 191 190 struct usb_hcd *hcd = dev_get_drvdata(dev); 192 191 struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); ··· 199 200 return 0; 200 201 } 201 202 202 - static int ehci_atmel_drv_resume(struct device *dev) 203 + static int __maybe_unused ehci_atmel_drv_resume(struct device *dev) 203 204 { 204 205 struct usb_hcd *hcd = dev_get_drvdata(dev); 205 206 struct atmel_ehci_priv *atmel_ehci = hcd_to_atmel_ehci_priv(hcd); ··· 207 208 atmel_start_clock(atmel_ehci); 208 209 return ehci_resume(hcd, false); 209 210 } 210 - #endif 211 211 212 212 #ifdef CONFIG_OF 213 213 static const struct of_device_id atmel_ehci_dt_ids[] = {