summaryrefslogtreecommitdiff
path: root/drivers/usb/host/xhci-plat.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-04-21 23:42:54 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-26 22:55:19 +0200
commitd852ed98f62e0d44f594adb850b3d6cedb5c9292 (patch)
treeb9caee6866a90c2f526a3a41799849070b34d937 /drivers/usb/host/xhci-plat.c
parent9f41ebfb7e395650f001c2f711833ef1a37ac0d4 (diff)
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: b0c69b4bace3 ("usb: host: plat: Enable xHCI plat runtime PM") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/host/xhci-plat.c')
-rw-r--r--drivers/usb/host/xhci-plat.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/drivers/usb/host/xhci-plat.c b/drivers/usb/host/xhci-plat.c
index 057571fab599..7c2a9e7c8e0f 100644
--- a/drivers/usb/host/xhci-plat.c
+++ b/drivers/usb/host/xhci-plat.c
@@ -355,8 +355,7 @@ static int xhci_plat_remove(struct platform_device *dev)
return 0;
}
-#ifdef CONFIG_PM_SLEEP
-static int xhci_plat_suspend(struct device *dev)
+static int __maybe_unused xhci_plat_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
@@ -378,7 +377,7 @@ static int xhci_plat_suspend(struct device *dev)
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 xhci_hcd *xhci = hcd_to_xhci(hcd);
@@ -393,10 +392,8 @@ static int xhci_plat_resume(struct device *dev)
return xhci_resume(xhci, 0);
}
-#endif /* CONFIG_PM_SLEEP */
-#ifdef CONFIG_PM
-static int xhci_plat_runtime_suspend(struct device *dev)
+static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev)
{
struct usb_hcd *hcd = dev_get_drvdata(dev);
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
@@ -404,14 +401,13 @@ static int xhci_plat_runtime_suspend(struct device *dev)
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 xhci_hcd *xhci = hcd_to_xhci(hcd);
return xhci_resume(xhci, 0);
}
-#endif /* CONFIG_PM */
static const struct dev_pm_ops xhci_plat_pm_ops = {
SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)