Skip to content

Commit d852ed9

Browse files
arndbgregkh
authored andcommitted
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: b0c69b4 ("usb: host: plat: Enable xHCI plat runtime PM") Signed-off-by: Arnd Bergmann <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 9f41ebf commit d852ed9

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

drivers/usb/host/xhci-plat.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,7 @@ static int xhci_plat_remove(struct platform_device *dev)
355355
return 0;
356356
}
357357

358-
#ifdef CONFIG_PM_SLEEP
359-
static int xhci_plat_suspend(struct device *dev)
358+
static int __maybe_unused xhci_plat_suspend(struct device *dev)
360359
{
361360
struct usb_hcd *hcd = dev_get_drvdata(dev);
362361
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
@@ -378,7 +377,7 @@ static int xhci_plat_suspend(struct device *dev)
378377
return ret;
379378
}
380379

381-
static int xhci_plat_resume(struct device *dev)
380+
static int __maybe_unused xhci_plat_resume(struct device *dev)
382381
{
383382
struct usb_hcd *hcd = dev_get_drvdata(dev);
384383
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
@@ -393,25 +392,22 @@ static int xhci_plat_resume(struct device *dev)
393392

394393
return xhci_resume(xhci, 0);
395394
}
396-
#endif /* CONFIG_PM_SLEEP */
397395

398-
#ifdef CONFIG_PM
399-
static int xhci_plat_runtime_suspend(struct device *dev)
396+
static int __maybe_unused xhci_plat_runtime_suspend(struct device *dev)
400397
{
401398
struct usb_hcd *hcd = dev_get_drvdata(dev);
402399
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
403400

404401
return xhci_suspend(xhci, true);
405402
}
406403

407-
static int xhci_plat_runtime_resume(struct device *dev)
404+
static int __maybe_unused xhci_plat_runtime_resume(struct device *dev)
408405
{
409406
struct usb_hcd *hcd = dev_get_drvdata(dev);
410407
struct xhci_hcd *xhci = hcd_to_xhci(hcd);
411408

412409
return xhci_resume(xhci, 0);
413410
}
414-
#endif /* CONFIG_PM */
415411

416412
static const struct dev_pm_ops xhci_plat_pm_ops = {
417413
SET_SYSTEM_SLEEP_PM_OPS(xhci_plat_suspend, xhci_plat_resume)

drivers/usb/host/xhci.h

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2004,13 +2004,8 @@ void xhci_init_driver(struct hc_driver *drv,
20042004
int xhci_disable_slot(struct xhci_hcd *xhci,
20052005
struct xhci_command *command, u32 slot_id);
20062006

2007-
#ifdef CONFIG_PM
20082007
int xhci_suspend(struct xhci_hcd *xhci, bool do_wakeup);
20092008
int xhci_resume(struct xhci_hcd *xhci, bool hibernated);
2010-
#else
2011-
#define xhci_suspend NULL
2012-
#define xhci_resume NULL
2013-
#endif
20142009

20152010
irqreturn_t xhci_irq(struct usb_hcd *hcd);
20162011
irqreturn_t xhci_msi_irq(int irq, void *hcd);

0 commit comments

Comments
 (0)