Skip to content

Commit 3ea75b3

Browse files
arndbgregkh
authored andcommitted
usb: xhci: tegra: mark PM functions as __maybe_unused
The added #ifdefs in the PM rework were almost correct, but still cause warnings in some randconfig builds: drivers/usb/host/xhci-tegra.c:2147:12: error: 'tegra_xusb_resume' defined but not used [-Werror=unused-function] 2147 | static int tegra_xusb_resume(struct device *dev) | ^~~~~~~~~~~~~~~~~ drivers/usb/host/xhci-tegra.c:2105:12: error: 'tegra_xusb_suspend' defined but not used [-Werror=unused-function] 2105 | static int tegra_xusb_suspend(struct device *dev) Replace the #ifdef checks with simpler __maybe_unused annotations to reliably shut up these warnings. Link: https://lore.kernel.org/all/[email protected]/ Fixes: 971ee24 ("usb: xhci: tegra: Enable ELPG for runtime/system PM") Reviewed-by: JC Kuo <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 5816b3e commit 3ea75b3

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

drivers/usb/host/xhci-tegra.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,6 @@ static int tegra_xusb_remove(struct platform_device *pdev)
17871787
return 0;
17881788
}
17891789

1790-
#if IS_ENABLED(CONFIG_PM) || IS_ENABLED(CONFIG_PM_SLEEP)
17911790
static bool xhci_hub_ports_suspended(struct xhci_hub *hub)
17921791
{
17931792
struct device *dev = hub->hcd->self.controller;
@@ -2102,7 +2101,7 @@ static int tegra_xusb_exit_elpg(struct tegra_xusb *tegra, bool runtime)
21022101
return err;
21032102
}
21042103

2105-
static int tegra_xusb_suspend(struct device *dev)
2104+
static __maybe_unused int tegra_xusb_suspend(struct device *dev)
21062105
{
21072106
struct tegra_xusb *tegra = dev_get_drvdata(dev);
21082107
int err;
@@ -2144,7 +2143,7 @@ static int tegra_xusb_suspend(struct device *dev)
21442143
return err;
21452144
}
21462145

2147-
static int tegra_xusb_resume(struct device *dev)
2146+
static __maybe_unused int tegra_xusb_resume(struct device *dev)
21482147
{
21492148
struct tegra_xusb *tegra = dev_get_drvdata(dev);
21502149
int err;
@@ -2174,10 +2173,8 @@ static int tegra_xusb_resume(struct device *dev)
21742173

21752174
return 0;
21762175
}
2177-
#endif
21782176

2179-
#ifdef CONFIG_PM
2180-
static int tegra_xusb_runtime_suspend(struct device *dev)
2177+
static __maybe_unused int tegra_xusb_runtime_suspend(struct device *dev)
21812178
{
21822179
struct tegra_xusb *tegra = dev_get_drvdata(dev);
21832180
int ret;
@@ -2190,7 +2187,7 @@ static int tegra_xusb_runtime_suspend(struct device *dev)
21902187
return ret;
21912188
}
21922189

2193-
static int tegra_xusb_runtime_resume(struct device *dev)
2190+
static __maybe_unused int tegra_xusb_runtime_resume(struct device *dev)
21942191
{
21952192
struct tegra_xusb *tegra = dev_get_drvdata(dev);
21962193
int err;
@@ -2201,7 +2198,6 @@ static int tegra_xusb_runtime_resume(struct device *dev)
22012198

22022199
return err;
22032200
}
2204-
#endif
22052201

22062202
static const struct dev_pm_ops tegra_xusb_pm_ops = {
22072203
SET_RUNTIME_PM_OPS(tegra_xusb_runtime_suspend,

0 commit comments

Comments
 (0)