Commit d852ed98 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Greg Kroah-Hartman

usb: host: xhci: remove #ifdef around PM functions

The #ifdef is slightly wrong as it doesn't cover the xhci_priv_resume_quirk()
function, causing a harmless warning:

drivers/usb/host/xhci-plat.c:58:12: error: 'xhci_priv_resume_quirk' defined but not used [-Werror=unused-function]
 static int xhci_priv_resume_quirk(struct usb_hcd *hcd)

A simpler way to do this correctly is to use __maybe_unused annotations
that let the compiler silently drop the functions when there is no
reference.

Fixes: b0c69b4b ("usb: host: plat: Enable xHCI plat runtime PM")
Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 9f41ebfb
...@@ -355,8 +355,7 @@ static int xhci_plat_remove(struct platform_device *dev) ...@@ -355,8 +355,7 @@ static int xhci_plat_remove(struct platform_device *dev)
return 0; return 0;
} }
#ifdef CONFIG_PM_SLEEP static int __maybe_unused xhci_plat_suspend(struct device *dev)
static int xhci_plat_suspend(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
...@@ -378,7 +377,7 @@ static int xhci_plat_suspend(struct device *dev) ...@@ -378,7 +377,7 @@ static int xhci_plat_suspend(struct device *dev)
return ret; return ret;
} }
static int xhci_plat_resume(struct device *dev) static int __maybe_unused xhci_plat_resume(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
...@@ -393,10 +392,8 @@ static int xhci_plat_resume(struct device *dev) ...@@ -393,10 +392,8 @@ static int xhci_plat_resume(struct device *dev)
return xhci_resume(xhci, 0); return xhci_resume(xhci, 0);
} }
#endif /* CONFIG_PM_SLEEP */
#ifdef CONFIG_PM static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev)
static int xhci_plat_runtime_suspend(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
...@@ -404,14 +401,13 @@ static int xhci_plat_runtime_suspend(struct device *dev) ...@@ -404,14 +401,13 @@ static int xhci_plat_runtime_suspend(struct device *dev)
return xhci_suspend(xhci, true); return xhci_suspend(xhci, true);
} }
static int xhci_plat_runtime_resume(struct device *dev) static int __maybe_unused xhci_plat_runtime_resume(struct device *dev)
{ {
struct usb_hcd *hcd = dev_get_drvdata(dev); struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd); struct xhci_hcd *xhci = hcd_to_xhci(hcd);
return xhci_resume(xhci, 0); return xhci_resume(xhci, 0);
} }
#endif /* CONFIG_PM */
static const struct dev_pm_ops xhci_plat_pm_ops = { static const struct dev_pm_ops xhci_plat_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume) SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)
......
...@@ -2004,13 +2004,8 @@ void xhci_init_driver(struct hc_driver *drv, ...@@ -2004,13 +2004,8 @@ void xhci_init_driver(struct hc_driver *drv,
int xhci_disable_slot(struct xhci_hcd *xhci, int xhci_disable_slot(struct xhci_hcd *xhci,
struct xhci_command *command, u32 slot_id); struct xhci_command *command, u32 slot_id);
#ifdef CONFIG_PM
int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup); int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
int xhci_resume(struct xhci_hcd *xhci, bool hibernated); int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
#else
#define xhci_suspend NULL
#define xhci_resume NULL
#endif
irqreturn_t xhci_irq(struct usb_hcd *hcd); irqreturn_t xhci_irq(struct usb_hcd *hcd);
irqreturn_t xhci_msi_irq(int irq, void *hcd); irqreturn_t xhci_msi_irq(int irq, void *hcd);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment