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

usb: hide unused usbfs_notify_suspend/resume functions

The declaration is in an #ifdef, which causes warnings when building
with 'make W=1' and without CONFIG_PM:

drivers/usb/core/devio.c:742:6: error: no previous prototype for 'usbfs_notify_suspend'
drivers/usb/core/devio.c:747:6: error: no previous prototype for 'usbfs_notify_resume'

Use the same #ifdef check around the function definitions to avoid
the warnings and slightly shrink the USB core.

Fixes: 7794f486ed0b ("usbfs: Add ioctls for runtime power management")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Link: https://lore.kernel.org/r/20230516202103.558301-1-arnd@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Arnd Bergmann and committed by
Greg Kroah-Hartman
8e6bd945 342161c1

+2
+2
drivers/usb/core/devio.c
··· 738 738 return 0; 739 739 } 740 740 741 + #ifdef CONFIG_PM 741 742 /* The following routines apply to the entire device, not interfaces */ 742 743 void usbfs_notify_suspend(struct usb_device *udev) 743 744 { ··· 757 756 } 758 757 mutex_unlock(&usbfs_mutex); 759 758 } 759 + #endif 760 760 761 761 struct usb_driver usbfs_driver = { 762 762 .name = "usbfs",