]> www.infradead.org Git - linux.git/commitdiff
usb: hide unused usbfs_notify_suspend/resume functions
authorArnd Bergmann <arnd@arndb.de>
Tue, 16 May 2023 20:17:42 +0000 (22:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 29 May 2023 14:49:21 +0000 (15:49 +0100)
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>
drivers/usb/core/devio.c

index e501a03d6c700b930b0a152bcb9c87dfe6f5ae7e..1622ad35428d0c2ffc82a7c67b633e3544e1a9db 100644 (file)
@@ -738,6 +738,7 @@ static int driver_resume(struct usb_interface *intf)
        return 0;
 }
 
+#ifdef CONFIG_PM
 /* The following routines apply to the entire device, not interfaces */
 void usbfs_notify_suspend(struct usb_device *udev)
 {
@@ -756,6 +757,7 @@ void usbfs_notify_resume(struct usb_device *udev)
        }
        mutex_unlock(&usbfs_mutex);
 }
+#endif
 
 struct usb_driver usbfs_driver = {
        .name =         "usbfs",