summaryrefslogtreecommitdiff
path: root/include/linux/usb.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2023-03-28 16:10:43 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-03-29 09:56:35 +0300
commit130eac4170859fb368681e00d390f20f44bbf27b (patch)
tree917fe3662422da7b1f176e135368ce17a6101bb1 /include/linux/usb.h
parentf54134b3fc7954dbaa4da42198286e49bcb48ed7 (diff)
downloadlinux-130eac4170859fb368681e00d390f20f44bbf27b.tar.xz
xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals
A recent patch caused an unused-function warning in builds with CONFIG_PM disabled, after the function became marked 'static': drivers/usb/host/xhci-pci.c:91:13: error: 'xhci_msix_sync_irqs' defined but not used [-Werror=unused-function] 91 | static void xhci_msix_sync_irqs(struct xhci_hcd *xhci) | ^~~~~~~~~~~~~~~~~~~ This could be solved by adding another #ifdef, but as there is a trend towards removing CONFIG_PM checks in favor of helper macros, do the same conversion here and use pm_ptr() to get either a function pointer or NULL but avoid the warning. As the hidden functions reference some other symbols, make sure those are visible at compile time, at the minimal cost of a few extra bytes for 'struct usb_device'. Fixes: 9abe15d55dcc ("xhci: Move xhci MSI sync function to to xhci-pci") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20230328131114.1296430-1-arnd@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include/linux/usb.h')
-rw-r--r--include/linux/usb.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 9642ee02d713..d510fabcafa2 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -704,13 +704,12 @@ struct usb_device {
unsigned long active_duration;
-#ifdef CONFIG_PM
unsigned long connect_time;
unsigned do_remote_wakeup:1;
unsigned reset_resume:1;
unsigned port_is_suspended:1;
-#endif
+
struct wusb_dev *wusb_dev;
int slot_id;
struct usb2_lpm_parameters l1_params;