Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

usb: dwc3: qcom: mark PM functions as __maybe_unused

The #ifdef guards around these are wrong, resulting in warnings
in certain configurations:

drivers/usb/dwc3/dwc3-qcom.c:244:12: error: 'dwc3_qcom_resume' defined but not used [-Werror=unused-function]
static int dwc3_qcom_resume(struct dwc3_qcom *qcom)
^~~~~~~~~~~~~~~~
drivers/usb/dwc3/dwc3-qcom.c:223:12: error: 'dwc3_qcom_suspend' defined but not used [-Werror=unused-function]
static int dwc3_qcom_suspend(struct dwc3_qcom *qcom)

This replaces the guards with __maybe_unused annotations to shut up
the warnings and give better compile time coverage.

Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver")
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>

authored by

Arnd Bergmann and committed by
Felipe Balbi
9925e6eb 93ef2dc0

+4 -8
+4 -8
drivers/usb/dwc3/dwc3-qcom.c
··· 548 548 return 0; 549 549 } 550 550 551 - #ifdef CONFIG_PM_SLEEP 552 - static int dwc3_qcom_pm_suspend(struct device *dev) 551 + static int __maybe_unused dwc3_qcom_pm_suspend(struct device *dev) 553 552 { 554 553 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 555 554 int ret = 0; ··· 560 561 return ret; 561 562 } 562 563 563 - static int dwc3_qcom_pm_resume(struct device *dev) 564 + static int __maybe_unused dwc3_qcom_pm_resume(struct device *dev) 564 565 { 565 566 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 566 567 int ret; ··· 571 572 572 573 return ret; 573 574 } 574 - #endif 575 575 576 - #ifdef CONFIG_PM 577 - static int dwc3_qcom_runtime_suspend(struct device *dev) 576 + static int __maybe_unused dwc3_qcom_runtime_suspend(struct device *dev) 578 577 { 579 578 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 580 579 581 580 return dwc3_qcom_suspend(qcom); 582 581 } 583 582 584 - static int dwc3_qcom_runtime_resume(struct device *dev) 583 + static int __maybe_unused dwc3_qcom_runtime_resume(struct device *dev) 585 584 { 586 585 struct dwc3_qcom *qcom = dev_get_drvdata(dev); 587 586 588 587 return dwc3_qcom_resume(qcom); 589 588 } 590 - #endif 591 589 592 590 static const struct dev_pm_ops dwc3_qcom_dev_pm_ops = { 593 591 SET_SYSTEM_SLEEP_PM_OPS(dwc3_qcom_pm_suspend, dwc3_qcom_pm_resume)